G
Guest
I have a grid view. In that gridview I have somecheck boxes in
EditItemTemplate. I need to validate those check boxes. I am using
customValidate controls and java script to validate check boxes. but it gives
me error message that IsActiveCheckBox is not found in current context. Mat
be checkbox is in EditItemTemplate field. I am not sure. How can I fix this.
e'g
<script language="javascript" type="text/javascript">
function ValidateIsActiveCs(source, args)
{
args.IsValid = document.getElementById('<%=IsActiveCheckBox.ClientID
%>').checked;
}
<asp:CheckBox ID="IsActiveCheckBox" runat="server" Checked='<%#
Bind("MyColumn") %>' />
<asp:CustomValidator ID="cvlIsActive" runat="server"
ClientValidationFunction="ValidateIsActiveCs" ErrorMessage="This field
should be checked">*</asp:CustomValidator></td>
EditItemTemplate. I need to validate those check boxes. I am using
customValidate controls and java script to validate check boxes. but it gives
me error message that IsActiveCheckBox is not found in current context. Mat
be checkbox is in EditItemTemplate field. I am not sure. How can I fix this.
e'g
<script language="javascript" type="text/javascript">
function ValidateIsActiveCs(source, args)
{
args.IsValid = document.getElementById('<%=IsActiveCheckBox.ClientID
%>').checked;
}
<asp:CheckBox ID="IsActiveCheckBox" runat="server" Checked='<%#
Bind("MyColumn") %>' />
<asp:CustomValidator ID="cvlIsActive" runat="server"
ClientValidationFunction="ValidateIsActiveCs" ErrorMessage="This field
should be checked">*</asp:CustomValidator></td>