Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

validation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bobby - 19 Sep 2007 22:04 GMT
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>
John - 20 Sep 2007 12:44 GMT
> I have a grid view.  In that gridview I have somecheck boxes in
> EditItemTemplate. I need to validate those check boxes.  I am using
[quoted text clipped - 14 lines]
>  ClientValidationFunction="ValidateIsActiveCs" ErrorMessage="This field
> should be checked">*</asp:CustomValidator></td>

I tried your code out and didn't get the error you had. However when
my submit button was clicked and the checkbox wasn't checked it
displayed the Text "*" not the ErrorMessage from the CustomValidator.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.