my code:
function ValidateAddress(source, args) {
debugger;
var chkaddress = document.getElementById("<%=chkbox.ClientID %>");
var address1 = document.getElementById("#<%=txtAddressLine1.ClientID %>").val();
if (chkaddress.checked) {
debugger;
if (address1 == "") {
args.IsValid = false;
}
else {
args.IsValid = true;
}
}
}

Pankaj Kumar198 reputationPosted Aug 6, 2013, 9:08 AM EDT
Here are the main properties of the CustomValidator control.
- ControlToValidate: The ID of the form field to validate.
- Text: Error message to be displayed.
- ClientValidationFunction: Client side function to call for client side validation.
This control also has an event that can be called after postback.OnServerValidate: This event will be raised after
Client-side validation Example
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="_default" %>Iftikar HussainRank #423 · 5.9K reputationPosted Aug 6, 2013, 8:30 PM EDT
You need to enable the client script property.
Regards,
Iftikar
manjula d131 reputationPosted Aug 6, 2013, 8:48 PM EDT
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 6, 2013, 8:51 PM EDT
Regards,
Iftikar