验证可从asp.net中的两个文本框中进行选择 [英] Validation to choose from two textboxes in asp.net
问题描述
Hello Friends,
正在使用c#,Sqlserver 2005数据库处理asp.net项目。
我需要验证文本框。
在我的网页上我有6个文本框,我对此进行了验证,罚款。
我需要验证文本框,该用户可以选择输入文本框。
我的文本框是
ModelNo - TxtModelNo
SerailNo - TxtSerailNo
AssignedTo - TxtAssignedTo
位置 - TxtLocation
CompanyTagNo - TxtCompanyTagNo
EmployeeTagNo - TxtEmployeeTagNo
来自这些文本框,前4个文本框是必需的,最后两个是在选择。
这两个文本框正在选择中
CompanyTagNo - TxtCompanyTagNo
EmployeeTagNo - TxtEmployeeTagNo
用户可以输入两个文本框或
他可以也可以输入一个或者
他也可以输入
但两者都不应该是空的。
请帮助,
谢谢
Hello Friends,
am working on asp.net project using c#, Sqlserver 2005 database.
I need validation for textboxes.
on my webpage i have 6 textboxes, i gave validations for this, its fine.
I need a validation for textbox, that user has the choice to enter in textboxes.
my textboxes are
ModelNo - TxtModelNo
SerailNo - TxtSerailNo
AssignedTo - TxtAssignedTo
Location - TxtLocation
CompanyTagNo - TxtCompanyTagNo
EmployeeTagNo - TxtEmployeeTagNo
from these textboxes, first 4 textboxes are required compulsory, and the last two are under choice.
These two textboxes are under choice
CompanyTagNo - TxtCompanyTagNo
EmployeeTagNo - TxtEmployeeTagNo
the user can enter in both textboxes OR
he can enter in one also OR
he can enter in both also
BUT both should not be empty.
Please help,
Thanks
推荐答案
你必须使用带有javascript功能的CustomValidator控件进行验证。试试以下链接...和其他必填文本框使用RequiredFieldValidator
http://forums.asp.net/post/4001929.aspx [ ^ ]
U have to use CustomValidator control with javascript fuction for validation .Try following link ...and for other required textbox use RequiredFieldValidator
http://forums.asp.net/post/4001929.aspx[^]
>
这篇关于验证可从asp.net中的两个文本框中进行选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!