I'm bit confused how to use customvalidator for two text box.... Following is the code I'd tried....
<asp:customvalidator id="emailvalidator" Runat="server" ControlToValidate="TxtMailId" Display="Dynamic"
ClientValidationFunction="CheckTextBox" EnableClientScript="True" ErrorMessage="Please fill Name or Email Id to Search." CssClass="error">
</asp:customvalidator>
function CheckTextBox(objsrc, objArgs)
{
var Valid1=false;
var EmailValue = document.Template.TxtEmail.value
var NameValue = document.Template.TxtEmail.value
if(EmailValue=="" && NameValue=="")
{
Valid1 = false;
}
else
{
Valid1 = true;
}
objArgs.IsValid=Valid1;
return;
}
Quote:
quote:Originally posted by r_ganesh76
what code have you written for validation in your customvalidator??
Regards
Ganesh
|