Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / JavaScript / January 2006



Tip: Looking for answers? Try searching our database.

Getting the collection of checkboxes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
vinod - 31 Jan 2006 07:26 GMT
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?
RobG - 31 Jan 2006 07:33 GMT
> Hi,
>   I have a form wherein there are around 200-300 rows of homogenous
[quoted text clipped - 6 lines]
> 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...

Signature

Rob

 
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



©2009 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.