Re: Getting the collection of checkboxes
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: Getting the collection of checkboxes

From: RobG <rgqld@iinet.net.au>
Date: Tue Jan 31 2006 - 08:33:11 CET

vinod wrote:
> Hi,
> I have a form wherein there are around 200-300 rows of homogenous
> data, each having around 30 input fileds of its own.So totally, there
> are more than 6000 input fields . Now, when the user submits this page,
> i need to loop through the checkboxes and identify the ones that are
> checked. I can't use the getElementsByName() since the checkbox names
> are different. I'm using getElementsByTagName("input"). Because of the
> huge amount of data, this method takes around 4-5 secs to evaluate
> before submitting the form. Is there some way to get the collection of
> checkboxes without having to loop through all the input fields?

No. But if you supply the loop code, you may get suggestions for
optimisation.

For example, it may be faster to use the forms.elements collection to
get the list, or to build an array of references onload so you have them
already, or maybe to track click events on each checkbox and remember
whether they are checked or not so you already know their status when
the form is submitted.

Show some code...

-- 
Rob
Received on Tue Feb 7 21:28:29 2006