Hi,
First you have to add the custom validator
<asp:CustomValidator ID="CV1" runat="Server" ClientValidationFunction="JSValidate"
ControlToValidate="firsttextboxname" ValidateEmptyText="True" ErrorMessage="Validation Failed"></asp:CustomValidator>
then add the following javascript -
<script language="javascript" type="text/javascript">
function JSValidate(source, args)
{
var firsttextbox= document.getElementById('<%=firsttextboxl.ClientID %>');
var secondtextboxl= document.getElementById('<%=secondtextboxl.ClientID %>');
var firstrbo= document.getElementById('<%=firstrbo.ClientID %>');
var secondrbo= document.getElementById('<%=secondrbo.ClientID %>');
if (firstrbo.checked == true)
{
if(firsttextbox.value == '')
{
alert('message');
args.IsValid = false;
}
else
{
args.IsValid = true;
}
}
//write same for second one
</script>
i hope this will help you.
Thanks & Regards,
Shailesh
Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator