Wednesday, August 3, 2011

Validation on Checkbox

 <script language="javascript" type="text/javascript"> 

function validateCheckBox1(source, args)
        {
            args.IsValid = document.getElementById('<%= Chk1.ClientID %>').checked;
        }
</script>

// call this with custom validator in HTML page

CheckBox ID="Chk1" runat="server" />
                      
<asp:CustomValidator runat="server" ID="CustomValidator4" Visible="true"
ClientValidationFunction="validateCheckBox2"
 ErrorMessage="Please confirm the authorisation 1" Display="Dynamic"  />

No comments:

Post a Comment