I have custom validators on the aspx page and user needs to see the error message in summary as soon as they tab out of the control.
To achieve this, I am calling Page_ClientValidate('')
on onblur event of each control. One of the custom validator I have is:
function ValidateCustomerId(oSrc, args) {
var txtCustomerId = document.getElementById(txtCustomerId);
if (txtCustomerId != null) {
var customerId = txtCustomerId.value;
if (!isInteger(customerId)) {
document.getElementById("customerIdAsterik").style.display = 'inline';
args.IsValid = false;
}
else {
document.getElementById("customerIdAsterik").style.display = 'none';
}
}
}
If user enters invalid entry and clicks on Cancel button, server side event is not getting fired untill it is clicked twice. Cancel button already has CausesValidation=false
. I think this behaviour is due to calling on Page_ClientValidate()
on onblur event, otherwise it works fine.
Is there to skip the client validations when they click on cancel button or is there any approach I could take to achieve this.