G
Guest
We want to require a value for CboCharity if the value for cboCardSource =
Fundraiser. Here's the client script:
<script language="javascript">
<!--
function ValidateCharity(source, arguments)
{
frmRegister.cboCardSource.IsValid = true;
if (frmRegister.cboCardSource.value == "Fundraiser")
{
if (frmRegister.cboCharity.value == "")
{
frmRegister.cboCardSource.IsValid = false;
}
}
}
//-->
</script>
Here's the CustomValidator:
<asp:customvalidator id="valFundraiser" runat="server"
ErrorMessage="A Fundraiser must be selected" Font-Size="X-Small"
Font-Names="Arial" ControlToValidate="cboCardSource"
ClientValidationFunction="ValidateCharity" Display="None">
</asp:customvalidator>
When the value of cboCardSource = "Fundrasier" and the value of cboCharity =
"" the ValidateCharity client script function runs and cboCardSource.IsValid
is set to false, however the validation summary never includes the error for
cboCardSource: "A Fundraiser must be selected". Why?
Fundraiser. Here's the client script:
<script language="javascript">
<!--
function ValidateCharity(source, arguments)
{
frmRegister.cboCardSource.IsValid = true;
if (frmRegister.cboCardSource.value == "Fundraiser")
{
if (frmRegister.cboCharity.value == "")
{
frmRegister.cboCardSource.IsValid = false;
}
}
}
//-->
</script>
Here's the CustomValidator:
<asp:customvalidator id="valFundraiser" runat="server"
ErrorMessage="A Fundraiser must be selected" Font-Size="X-Small"
Font-Names="Arial" ControlToValidate="cboCardSource"
ClientValidationFunction="ValidateCharity" Display="None">
</asp:customvalidator>
When the value of cboCardSource = "Fundrasier" and the value of cboCharity =
"" the ValidateCharity client script function runs and cboCardSource.IsValid
is set to false, however the validation summary never includes the error for
cboCardSource: "A Fundraiser must be selected". Why?