Why is this CustomValidator client function not firing?
- by xaisoft
I have a dropdown with the Id of "BACKGROUND" and if nothing is selected or the value is other, it should fire my client side validation function, but it is not. Am I missing something?
I have the following client side function:
function cv26(oSrc, args) {//BACKGROUND,BG_OTHER
alert("cv26");
var otherCtrl = document.getElementById("BG_OTHER");
args.IsValid = (args.Value != " ") || (otherCtrl.value.length > 0);
}
My Custom validator looks like this:
<asp:CustomValidator ID="cv26" runat="server" ErrorMessage="26. Background is required." ControlToValidate="BACKGROUND" ClientValidationFunction="cv26" Display="Dynamic" ValidateEmptyText="true">*</asp:CustomValidator>