I'm using ASP.NET Pages and CustomValidator control to validate set of controls. Also I'm using ClientValidation property and my custom javascript function. My main issue is : when I setting 'ControlToValidate' property - validation function stop calling. I've check everything twice, set ID's for validator and control to validate, but still no result.
Does anybody know how to fix my situation?
P.S. Main reason why I need to set ControlToValidate property is that I want to fire validation stright after lost control focus
UPDATE : here is validator :
<asp:CustomValidator ID="cvEmail1" runat="server" ClientValidationFunction="ValidateEmail"
Display="Dynamic" EnableClientScript="True" ForeColor="Red" ErrorMessage="This field is required"/>
and thi is validation function :
<script type="text/javascript">
function ValidateEmail(sender, args) {
var isValid = myCheck();
args.IsValid = isValid;
}
</script>
ValidateEmptyTextto true. That's also true for ListControls(SelectedIndex == -1). PS: You could also force client validationonblurwithPage_ClientValidate("validationGroup"). - Tim Schmelter