次の検証があり、残りのフィールドでは正常に機能していますが、チェックボックスの検証サマリーの一部としてカスタムバリデーターを機能させようとしていますが、喜びはありません。
これは私が今持っているものです
<script language="javascript" type="text/javascript">
function ValidateTandCs(source, args)
{
args.IsValid = document.getElementById('<%= optIn.ClientID %>').checked;
}
</script>
<asp:ValidationSummary CssClass="highlight"
id="ValidationSummary1"
HeaderText="<p>Please amend these errors below to continue with your
application.</p>" Runat="server" />
<asp:CheckBox id="optIn" runat="server"></asp:CheckBox> I agree to the terms and
conditions of this site and I wish to Opt In for registration.
<asp:CustomValidator ID="valTandCs" ClientValidationFunction="ValidateTandCs"
ValidationGroup="ValidationSummary1" runat="server"
ErrorMessage="Please accept Terms and Conditions before submitting.">
</asp:CustomValidator>
しかし、[送信]をクリックすると、他のフィールドのエラーメッセージのみが表示され、このチェックボックスには何も表示されません...アイデアはありますか?