主题:  关于textfield内空白的问题!!

herdsboy

职务:普通成员
等级:1
金币:0.0
发贴:131
注册:2001/5/15 23:31:12
#12001/5/20 21:52:53
关于textfield内空白的问题!!如果在数据库里定义的某个字段为必填的话,某个textfield不填就会有什么obdc错误之类的,有什么办法在ud里规定用户必填字符的?一旦不填,趟出msgbox警告一下?



weicong

职务:普通成员
等级:1
金币:1.0
发贴:136
注册:2001/5/13 13:40:55
#22001/5/20 22:47:22
到www.cmmail.com看看别人怎么写,参考参考.



herdsboy

职务:普通成员
等级:1
金币:0.0
发贴:131
注册:2001/5/15 23:31:12
#32001/5/21 9:49:34
没有哇?对了weicong.我这问题本来就是要问你的,忘了打上去了,能不能跟我说清楚一点?



weicong

职务:普通成员
等级:1
金币:1.0
发贴:136
注册:2001/5/13 13:40:55
#42001/5/21 10:54:45
你的mail,我看了,看看我回给你的mail吧!



blshfw

职务:普通成员
等级:1
金币:1.0
发贴:241
注册:2001/5/15 16:44:13
#52001/5/22 10:47:00
很简单呀!在behaviors里有个Validate Form行为是专门来验证窗体的文本输入的。有问题mail我:fw@gxkc.com.cn ;)



weicong

职务:普通成员
等级:1
金币:1.0
发贴:136
注册:2001/5/13 13:40:55
#62001/5/22 13:33:07
噢!我一直都人工写!!!!!
herdsboy,这样更方便!


Validate Form

The Validate Form action checks the contents of specified text fields to ensure that the user has entered the correct type of data. Attach this action to individual text fields with the onBlur event to validate the fields as the user is filling out the form, or attach it to the form with the onSubmit event to evaluate several text fields at once when the user clicks the Submit button. Attaching this action to a form prevents the form from being submitted to the server if any of the specified fields contains invalid data.

To use the Validate Form action:

1 Choose Insert > Form or click the Form button on the Objects panel to insert a form.
2 Choose Insert > Form Objects > Text Field or click the Text Field button on the Objects panel to insert a text field.
Repeat this step to insert additional text fields.
3 Do one of the following:
To validate individual fields as the user fills out the form, select a text field and choose Window > Behaviors.
To validate multiple fields when the user submits the form, click the tag in the tag selector in the bottom left corner of the Document window and choose Window > Behaviors.
4 Choose Validate Form from the Actions pop-up menu.
5 Do one of the following:
If you are validating individual fields, select the same field that you have selected in the Document window from the Named Fields list.
If you are validating multiple fields, select a text field from the Named Fields list.
6 Select the Required option if the field must contain some data.
7 Choose from one of the following Accept options:
Use Anything if the field is required but need not contain any particular kind of data. (If the Required option is not selected, the Anything option is meaningless—that is, it is the same as if the Validate Form action were not attached to the field.)
Use E-mail address to check that the field contains an @ symbol.
Use Number to check that the field contains only numerals.
Use Number From to check that the field contains a number in a specific range.
8 If you are validating multiple fields, repeat steps 6 and 7 for any additional fields that you want to validate.
9 Click OK.
If you are validating multiple fields when the user submits the form, the onSubmit event automatically appears in the Events pop-up menu.
10 If you are validating individual fields, check that the default event is onBlur or onChange.
If it isn't, select onBlur or onChange from the pop-up menu. Both of these events trigger the Validate Form action when the user moves away from the field. The difference between them is that onBlur occurs whether or not the user has typed in the field, and onChange occurs only if the user changed the contents of the field. The onBlur event is preferred when you have specified that the field is required.



herdsboy

职务:普通成员
等级:1
金币:0.0
发贴:131
注册:2001/5/15 23:31:12
#72001/5/23 13:47:45
谢谢你们了!哇,好长的英文,读的我好辛苦,问题解决了,啥时候请你们吃一顿。



blshfw

职务:普通成员
等级:1
金币:1.0
发贴:241
注册:2001/5/15 16:44:13
#82001/5/24 10:54:07
那我要吃肯德鸡!!



weicong

职务:普通成员
等级:1
金币:1.0
发贴:136
注册:2001/5/13 13:40:55
#92001/5/25 10:21:27
我要麦当劳.