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;
}
}
}
Iftikar HussainPosted Aug 7, 2013, 12:51 AM
Regards,
Iftikar
manjula dPosted Aug 7, 2013, 12:48 AM
Iftikar HussainPosted Aug 7, 2013, 12:30 AM
You need to enable the client script property.
Regards,
Iftikar
Pankaj KumarPosted Aug 6, 2013, 1:08 PM
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" %>