I've got the following javascript code, which enables a bunch of validators.
ValidatorEnable(document.getElementById("<%=AddressValidator.ClientID %>"), true);
ValidatorEnable(document.getElementById("<%=CityValidator.ClientID %>"), true);
ValidatorEnable(document.getElementById("<%=CountryValidator.ClientID %>"), true);
My problem is that when the validators are enabled with the above code, the error message (i.e. the validation text) is displayed. How can I hide the error message just for this instance when they're being enabled?
If you want to enable it without validating:
document.getElementById("<%=AddressValidator.ClientID %>").enabled = true;
Because ValidatorEnable
internally looks like:
function ValidatorEnable(val, enable) {
val.enabled = (enable != false);
ValidatorValidate(val);
ValidatorUpdateIsValid();
}
http://sandblogaspnet.blogspot.de/2009/04/calling-validator-controls-from.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With