I have two textboxes on my asp.net page and a submit button. How can I use a single or more RequiredFieldValidators to check if at least one of the two textboxes has some text inside on submit button click?
相关问题
- Carriage Return (ASCII chr 13) is missing from tex
- How to store image outside of the website's ro
- 'System.Threading.ThreadAbortException' in
- Request.PathInfo issues and XSS attacks
- How to dynamically load partial view Via jquery aj
相关文章
- asp.net HiddenField控件扩展问题
- asp.net HiddenField控件扩展问题
- Asp.Net网站无法写入错误日志,测试站点可以,正是站点不行
- asp.net mvc 重定向到vue hash字符串丢失
- FormsAuthenticationTicket expires too soon
- Angular Material Stepper causes mat-formfield to v
- “Dynamic operations can only be performed in homog
- What is the best way to create a lock from a web a
You can also use ClientValidationFunction attribute with CustomValidator and client side function
Along with two text boxes add a CustomValidator and call server side validation.
Server side function
Hope this helps you.
First of all, if a field is not certainly required you shouldn't use a RequiredFieldValidator instead you can use a CustomValidator.
This quote is from Using the CustomValidator Control By Scott Mitchell.
You can also check this Dynamically enable or disable RequiredFieldValidator based on value of DropDownList because if you are supposed to use a RequiredFieldValidator you will need to disable one of the two dynamically if one of the TextBox is valid.