[thelist] Dumb Question (Javascript) but still causing diffic ulties
Tom Dell'Aringa
pixelmech at yahoo.com
Tue May 11 15:44:18 CDT 2004
--- Emma Jane Hogbin <emmajane at xtrinsic.com> wrote:
> No. Checkboxes should all have the same name. It's the value that
> should be different. A set of checkboxes is the equivalent of an
> array of items. If you want to access specific checkboxes you can
> either call them by their position in the array, or assign them
> unique IDs.
Checkboxes should only have the same name IF they are adding values
to the same property:
http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.2 (see under
Checkboxes)
Otherwise, a checkbox should have a unique control name to access its
current value.
Agreed you could access them by array position, true. I probably
spoke a bit too soon in that I'm not really sure how he is processing
the items...
--- Rob Smith <rob.smith at THERMON.com> wrote:
> Tom. I'd disagree with you in it's bad design. It's rather
> efficient actually. Instead of 60 if else statements, I have one
for
> loop. Any who.
So I guess it depends on what kind of processing you are doing on
that page. In general terms, I prefer my checkboxes to have a unique
control name unless those values are all tied to one property.
Granted if you have a million checkboxes, the situation may be
different. See how quick answers get you in trouble!
Tom
=====
http://www.Pixelmech.com/ - read my latest blog posting!
http://www.thywordistruth.net/ - Eternal Life
There is no missing link, just a fist shaken toward God.
More information about the thelist
mailing list