You often have the situation when you want to force the validation of the ASP:RegularExpressionValidator using JavaScript.
This is usually because for some reason the Validator is not actioned automatically like: the submit button was initially disabled, or the value of the input to validate is changed through JavaScript.
So you can force the validation of the ASP:RegularExpressionValidator using the Page_ClientValidate JavaScript function.
Code:
Calling that function will cause the validation of all Validators on the page, so if you want to validate only a Validator which corresponds to a specific ValidationGroup then you would call that JavaScript function like this:
Code:
Good luck,Roman
2 comments:
Thank you, this solved my issue!!!
I'm glad to see that my articles are helping people. ;)
Post a Comment
your thoughts are welcome: