Hi all,
I have a asp.net form, inside has a webcombo, I placed a requiredfieldvalidator and want to validate it, but cannot choose the webcombo control inside the requirefieldvalidator.
Can you suggest me how to ensure user choose a value in webcombo before submit the form?
Thank you very much for your help! Happy new year!
I am running into an issue where I am trying to validate more than 1 webcombo
I think the issue is that the customvalidator is not tied to the control. So having multiple customvalidators doesn't work.
any ideas?
Thanks kuldeepvija, this works fine(don't forget to set EnableClientScript to True if you disabled it)
{
}
<asp:CustomValidator ID="cvPortName" runat="server" ErrorMessage="Please select a Port" ClientValidationFunction="ValidatePort" Display="None"></asp:CustomValidator>
This works fine for me, see if it helps you.
Happy coding
You can use basic HTML/Javascript
Just use a JavaScript onSubmit event handler, check any value in the control you want and either return true and let the submit happen or return false and provide a warning; you can use a simple alert box or use the Dom to write an error to the page.
Thanks. So must validate the field after post back? Cannot check in client side?