验证控件 [英] Validating Controls
问题描述
嘿,
我正在使用一些要通过某些特定属性进行验证的控件.我要验证的控件是-
1) txtName -仅可以使用字母,限制最多为40个,并且是强制性的.
2) txtAddress -应该为所有字符加上字符,强制并限制为100.
3) txtPhone -应该只接受整数,没有空格,限制为12.
4) ddlSearchItems -必须选择项目(> 0)和必须.
5) txtQuantity -应该只接受整数,强制性,无空格,并且最多限制为4个且为强制性.
6) btnSubmit -如果datatable( dtValues.rows.count< = null )为null,则应禁用.否则启用.
谢谢
授予
Hey there,
i am using some controls which i want to validate with some particular properties.My controls to validate are-
1) txtName -- it should take only alphabets,limit should be upto 40 and is mandatory.
2) txtAddress -- should tale all characters,mandatory and limit 100.
3) txtPhone - should take only integers,No Space and limit 12.
4) ddlSearchItems -- item must be selected(>0) and mandatory.
5) txtQuantity -- should take only integers,mandatory,No Space and limit upto 4 and mandatory.
6) btnSubmit -- should be disabled if datatable(dtValues.rows.count <= null) is null,else enabled.
Thanks
Amit
推荐答案
使用验证控件,它将满足您的大多数条件.
对于其他用户,请使用Javascript.
Use Validation Controls, it''ll fulfill most of your conditions.
For others, use Javascript.
必填字段:使用必填字段验证器.
长度:使用文本框的最大长度属性.
对于正则表达式在此处检查 [ ]
Mandatory fields: use required field validator.
Length: Use maximum length property of text box.
For regular expressions Check here[]
这篇关于验证控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!