you can even prevent postback if the checkbox is unchecked.
Button1.Attributes["onclick"] =
"if (!$get('" + CheckBox1.ClientID + "').checked){alert('Agree with us,plz!');return false;}";
why do all things check if it can be prevented :)
or if you are trying to make the group invalid tou to do this, you can get your own client side check:
function myStartUpValidation(group){
var result=true;
for (var i = 0; i < Page_Validators.length; i++) {
if(Page_Validators[i].validationGroup==group){
try{
ValidatorValidate(Page_Validators[i]);
if(Page_Validators[i].isvalid==false){result=false;}
}catch(err){}
}
}
return result;
}
or additional validator ...
source
share