NEWS

Monday, July 18, 2011

Fire an ASP.NET Validator from JavaScript (CustomValidator as well)

ValidatorEnable(clientIdOfCustomValidator,true/false);


When you call ValidatorEnable(clientIdOfCustomValidator,true), it will enable the client validator and fire up client validator function.


When you call ValidatorEnable(clientIdOfCustomValidator,false), it will disable the client validator and also remove the validation message from UI if it displayed.

You can call a validator to validate by using the following code:

ValidatorValidate('myValidatorID');
 
If you want to see more, just have a look at the WebUIValidation.js file that is somewhere in you system (just search for it).

No comments:

Post a Comment