I have a page where the user enters address data. They can select a country from a drop down list. Depending on what country is selected, the user enters their province/state by either a textbox or a drop down list.
If they select USA/Canada, a drop down list is populated with the states/provinces and made visible, while the state textbox is made invisible. If they select a country other than USA/Canada, the state drop down list is made invisible, and a state textbox is made visible. The first item in the drop down list is "select your state/province" with a value of "".
here is my validator:
<asp:CustomValidator ID="cvState" runat="server" ClientValidationFunction="validateStateSelection" ErrorMessage="* Required" ControlToValidate="ddlCountry" ValidateEmptyText="True"></asp:CustomValidator></td>
here is my validation function:
function validateStateSelection(source, arguments)
alert("client validation func called");
if(arguments.Value == null || arguments.Value == "")
arguments.IsValid = false;
arguments.IsValid = true;