requiredfieldvalidator
-
Hi, I have four textboxes in my web page. I want to apply required field validator such that atleast one of the text box value is required,it is mandatory to have value in any one of the four . how to validate that.
-
Hi, I have four textboxes in my web page. I want to apply required field validator such that atleast one of the text box value is required,it is mandatory to have value in any one of the four . how to validate that.
You can use requiredfiledvalidator property of textboxex.
Your name:
Use the Textbox name as per ur project. -
You can use requiredfiledvalidator property of textboxex.
Your name:
Use the Textbox name as per ur project.My requirement is that i need only one textbox out of four to be validated, it can be any textbox. If i use required field validator for all textbox, it validates all four textboxes which is not my need. It is sufficient to have value in any of these four
-
Hi, I have four textboxes in my web page. I want to apply required field validator such that atleast one of the text box value is required,it is mandatory to have value in any one of the four . how to validate that.
-
My requirement is that i need only one textbox out of four to be validated, it can be any textbox. If i use required field validator for all textbox, it validates all four textboxes which is not my need. It is sufficient to have value in any of these four
Take Foyr textbox on the page... make one function "txtnull" and copy the code... ------------------------------------------------------------------ protected void Button1_Click(object sender, EventArgs e) { txtnull(); if (n == 4) { Response.Write("alert('Atleast one')"); return; } } int n = 0; private void txtnull() { if (TextBox1.Text == "") { n++; } if (TextBox2.Text == "") { n++; } if (TextBox3.Text == "") { n++; } if (TextBox4.Text == "") { n++; } } ------------------------------------------------------------------
-
I think it is not possible for requiredfield validator to validate multiple controls. Try with custom validator.
Done..
-
Hi, I have four textboxes in my web page. I want to apply required field validator such that atleast one of the text box value is required,it is mandatory to have value in any one of the four . how to validate that.
As sugested, use customvalidator and in the js function write your code to check your requirement.It can't be done through requiredfieldvalidator
Cheers!! Brij