I have three SELECT boxes with three different NAMEs, like
<select name="a">
<option>something</option>
<option>something</option>
</select>
<select name="b">
<option>something</option>
<option>something</option>
</select>
<select name="c">
<option>something</option>
<option>something</option>
</select>
Before sending the form, I would like to join the three selects into one, as my PHP script on the other side can only handle the object/array “a”.
I thought it could work like like this:
<input type="hidden" name="temp" value="" />
<a href="#" onclick="document.formIndex.temp.value = \n
document.formIndex.a.value.concat(document.formIndex.b.value,
document.formIndex.c.value); alert(document.formIndex.c.value);
document.formIndex.a.value = document.formIndex.temp.value;
document.formIndex.submit(); return false" class="search_button">
search
</a>
But that doesn’t work. Thanks for any tips what I should do.
Just give them the same name, and the browser will send three values with the same key to the server: