By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,101 Members | 1,394 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,101 IT Pros & Developers. It's quick & easy.

Getting the collection of checkboxes

P: n/a
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?

Jan 31 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
Jan 31 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.