i have web form, it has two radio buttons and two panels, each panel will be made visible/invisible based on the radion button selection. there are a few RequiredValidators at the end of the form(not locate in panels). i grouped the validators based on panels.
my question is: how to disable/invisible the group validator based on the selection of the radio button OR based on the visiblity/invisibity of panels?
my code sample:
<asp:RequiredFieldValidator ID="AddressLine1Validator" runat="server" ErrorMessage="Address Line 1 required" ValidationGroup="valIndivDelGroup" ControlToValidate="txtBox_IndivDelAddressLine1" Display="None"></asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="PostcodeValidator" runat="server" ErrorMessage="Postcode required" ValidationGroup="valIndivDelGroup" ControlToValidate="txtBox_IndivDelPostcode" Display="None"></asp:RequiredFieldValidator>
thanks a lot
There is a built-in function to do this:
var myVal = document.getElementById('<
will disable the validator, true will enable it.