RTKHOT
asked on
RequiredFieldValidator issue
My web page has an online form with about 40 textbox fields placed one below the other. Each textbox has a RequiredFieldValidator attached to it which gives an error if the textbox is left empty.
Everything is working well. But the problem is that the submit button is at the bottom. If the user has left some textbox empty on the top, then the submit click wont work, but the user will not know since the textbox giving error is on top.
Is there anyway i can catch if any of the validators has given an error, then i could show a message near the submit button that some field above has been left empty.
Everything is working well. But the problem is that the submit button is at the bottom. If the user has left some textbox empty on the top, then the submit click wont work, but the user will not know since the textbox giving error is on top.
Is there anyway i can catch if any of the validators has given an error, then i could show a message near the submit button that some field above has been left empty.
Validation summary control near to the submit button
ASKER
No. That give the error message of each field. I just want a common message such as "Please check all above items".
Validation summary gives the error message of each field. if the client has left all 40 textboxes empty, it will be a problem
Validation summary gives the error message of each field. if the client has left all 40 textboxes empty, it will be a problem
OnClientClick call javascript function and set the common message of the error message holder near submit button if atleast one of the validation fails.
ASKER
and how do i check if any one validation has failed? does the validator control return anything that i can check?
Not through the validator, but from Textboxe's values as follows
if (document.getElementById(" TextBox1") .value.tri m().length == 0 || document.getElementById("T extBox2"). value.trim ().length == 0
|| document.getElementById("T extBox3"). value.trim ().length == 0) {
//Set the message here
}
return false;
if (document.getElementById("
|| document.getElementById("T
//Set the message here
}
return false;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.