I\'ve done some searching on this, and I\'ve found several partial answers, however nothing that gives me that warm fuzzy \"this is the right way to do this\". To answer the
javascript function for client side validation (using jQuery)...
function CheckBoxRequired_ClientValidate(sender, e)
{
e.IsValid = jQuery(".AcceptedAgreement input:checkbox").is(':checked');
}
code-behind for server side validation...
protected void CheckBoxRequired_ServerValidate(object sender, ServerValidateEventArgs e)
{
e.IsValid = MyCheckBox.Checked;
}
ASP.Net code for the checkbox & validator...
You must select this box to proceed.
and finally, in your postback - whether from a button or whatever...
if (Page.IsValid)
{
// your code here...
}