all groups > asp.net datagrid control > september 2005 >
You're in the

asp.net datagrid control

group:

Checkbox Validation in DataGrid


Checkbox Validation in DataGrid arif.mosharraf NO[at]SPAM gmail.com
9/24/2005 8:31:30 PM
asp.net datagrid control:
Hi!

I have a datagrid containing one checkbox in each row. I have to do a
client side validation that atleast one checkbox is checked. I have
tried to attach a javacript on the save button but javascript couldn't
access the ID of the checkbox! If I throw an alert it says "undefined".
It is not able to find the checkbox control inside datagrid. How I can
access checkbox control using javascript?

-Arif
Re: Checkbox Validation in DataGrid Peter Blum
9/26/2005 11:25:43 AM
Any time you use javascript to access the HTML of a web control, use the
value from the ClientID property of the web control. The ClientID is
intended for looking up something on the client-side.

FYI: My Professional Validation And More"
(http://www.peterblum.com/vam/home.aspx) offers 25 validators including the
CountTrueConditionsValidator which handles this case nicely, and works on
many more browsers than client-side validation does in ASP.NET 1.x.

--- Peter Blum
www.PeterBlum.com
Email: PLBlum@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

[quoted text, click to view]

Re: Checkbox Validation in DataGrid Arif
9/26/2005 12:14:06 PM
Hello!

You made my day. It works. Thanks again.

-Arif

--
Sent via .NET Newsgroups
AddThis Social Bookmark Button