Revision: 45317
Updated Code
at April 28, 2011 12:31 by housecor
Updated Code
public void ValidateChecked(object sender, ServerValidateEventArgs e)
{
e.IsValid = chkMyChkBox.Checked;
}
//Client side method, referenced in customvalidtor ClientValidationFunction attribute:
<script type="text/javascript" language="javascript">
function ValidateCheckboxIsChecked(sender, args)
{
args.IsValid = (document.getElementById("CheckBox1").checked);
}
</script>
Revision: 45316
Updated Code
at April 28, 2011 12:30 by housecor
Updated Code
public void ValidateChecked(object sender, ServerValidateEventArgs e)
{
e.IsValid = chkMyChkBox.Checked;
}
//Client side method:
<script type="text/javascript" language="javascript">
function CustomValidator1_ClientValidate(sender, args)
{
args.IsValid = (document.getElementById("CheckBox1").checked);
}
</script>
Revision: 45315
Updated Code
at April 28, 2011 11:22 by housecor
Updated Code
public void ValidateChecked(object sender, ServerValidateEventArgs e)
{
e.IsValid = chkMyChkBox.Checked;
}
Revision: 45314
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at April 28, 2011 11:17 by housecor
Initial Code
public void ValidateChecked(object sender, ServerValidateEventArgs e)
{
CheckBox chkBox = sender as CheckBox;
e.IsValid = chkBox.Checked;
}
Initial URL
Initial Description
RequiredFieldValidator doesn't support checkboxes, but a customvalidator does the trick.
Initial Title
Require checkbox via customvalidator
Initial Tags
Initial Language
C#