I wonder if there is a way to connect a custom function to asp net client-side validation, so every time the validation is triggered by any control, I can do some magic on the client-side user interface
I am looking for a general approach to catching an onvalidating event page without setting it on every control that causes a postback
Thanks guys,
Edit:
I finished this function: (thanks @Kirk)
$(document).ready(function () {
$('form').submit(function () {
if (typeof Page_Validators != 'undefined') {
var errors = '';
$.each(Page_Validators, function () {
if (!this.isvalid) {
errors += this.errormessage + '\r\n';
}
});
if (errors.length > 0) {
Alert(errors);
}
}
});
});
Milox source
share