R
Rowena
I can't get my checkbox to validate, I have server and clientside code. Thanks!
<script type="text/javascript">
function CustomValidatorAgree_ClientValidate() {
alert("Yay!");
var chk = document.getElementById("fvMain_chkRulesAndRegs");
var validator = document.getElementById("fvMain_cvRulesAndRegs");
validator.isValid = chk.checked;
}
</script>
<asp:CheckBox runat="server" id="chkRulesAndRegs" Text="I have read and
understood the Rules and Regulations." />
<asp:CustomValidator ID="cvRulesAndRegs" Text="Required!" runat="server"
ValidationGroup="main" OnServerValidate="CustomValidatorAgree_ServerValidate"
ClientValidationFunction="CustomValidatorAgree_ClientValidate"
ControlToValidate="Burn_Address" />
Protected Sub CustomValidatorAgree_ServerValidate()
CType(fvMain.FindControl("cvRulesAndRegs"), CustomValidator).IsValid =
CBool((CType(fvMain.FindControl("chkRulesAndRegs"), CheckBox).Checked))
End Sub
<script type="text/javascript">
function CustomValidatorAgree_ClientValidate() {
alert("Yay!");
var chk = document.getElementById("fvMain_chkRulesAndRegs");
var validator = document.getElementById("fvMain_cvRulesAndRegs");
validator.isValid = chk.checked;
}
</script>
<asp:CheckBox runat="server" id="chkRulesAndRegs" Text="I have read and
understood the Rules and Regulations." />
<asp:CustomValidator ID="cvRulesAndRegs" Text="Required!" runat="server"
ValidationGroup="main" OnServerValidate="CustomValidatorAgree_ServerValidate"
ClientValidationFunction="CustomValidatorAgree_ClientValidate"
ControlToValidate="Burn_Address" />
Protected Sub CustomValidatorAgree_ServerValidate()
CType(fvMain.FindControl("cvRulesAndRegs"), CustomValidator).IsValid =
CBool((CType(fvMain.FindControl("chkRulesAndRegs"), CheckBox).Checked))
End Sub