ValidatorEnable
A nifty way to enable and disable all .Net validator controls is the use the ValidatorEnable() method. There are two parameters that constitute the method signature:
parm 1: instance of the validator control to be enabled/disabled.
parm 2: enabled indicator (true = enabled, false = disabled).
If I had the following validation control:
<asp:RequiredFieldValidator ID="vldCustName" runat="server"
ControlToValidate="txtCustomerName"
ErrorMessage="Customer Name Required">
</asp:RequiredFieldValidator>
I can disable the control like so:
ValidatorEnable($get('<%= txtCustomerName.ClientID %>'), false);
Please note that this is using the ASP.Net Ajax Framework to access the server control, hence the "$get('<%= txtCustomerName.ClientID %>')" line of code.
Comments