Forum Moderators: open
To make a long story short, one option that I have is to name two drop-down lists the same (like "category").
Basically, the first dropdown is about the first category (say we select "business"), and the second dropdown is about the secondary category (say we select "advertising").
May understanding was that when the form is submitted, the two dropdowns - since they have the same name - will be concatenated. For example the value passed to the next page would be something like this:
"business, advertising".
Today my assumption was callenged in a discussion by this statement:
"On a side note, html forms cannot have two fields with the same name, it just doesn't work, sometimes it may concatenate them, sometimes it will only use the last entered value, and sometimes it will not record a value at all."
Is this true?
I know it always works with checkboxes (since many times they have the same name), but is it true for drop-downs?
(By the way, I do know that another option is to use a multi-select list, but I would really like to know if the above statement is true.)
Thanks!
NB
Apologies for this having fallen through the cracks for so long!
I believe for a strict point of view you should not have two select elements of the same name or ID. I think that the concatenation depends on your web/app server technology.
In order to get the choices from these different elements to the backend processor we need to identify them individually by name...