0
votes

I use .net RequiredFieldValidator control for those required fields validation, but I also need to verify fields using regular expression,and some other logic, so I also added OnClientClick event function to the submit button. But I found after adding the OnClientClick event, all requiredfieldvalidator validation events are not fired after clicking submit button. Why? if it is the mechanism, how can I use both of them?

1
Did you add it programatically with = or +=? - Narnian
it's like OnClientClick="return CheckForm();" - Steven Zack

1 Answers

0
votes

I've run into the same problem in the past. I haven't dug into the why, but I've called the Page_ClientValidate('ValidationGroup') javascript function directly in my OnClientClick event.

For example:

OnClientClick="if(Page_ClientValidate('Zip')) DoSomething();"