passing all elements in a select box at once
Posted: Thu May 12, 2005 6:05 am
i have a select box and i want to pass every option of the select box with post not just what is selected in that box. I have it so there is a big list of options in 1 select box then you can move the diffrent options to other select boxes on the site depending on where you want to put them. when the user hits submit i want to take all the values from all the select boxes and use php to get them via post.
i was thinking maybe do a onclick on the submit button to take all of the options from list A and make a hidden field like
<input type="hidden" name="A[]" value="option1">
<input type="hidden" name="A[]" value="option2">
then for list B
<input type="hidden" name="B[]" value="option3">
<input type="hidden" name="B[]" value="option4">
but thats just a idea...anyone know how to do any of this?
i was thinking maybe do a onclick on the submit button to take all of the options from list A and make a hidden field like
<input type="hidden" name="A[]" value="option1">
<input type="hidden" name="A[]" value="option2">
then for list B
<input type="hidden" name="B[]" value="option3">
<input type="hidden" name="B[]" value="option4">
but thats just a idea...anyone know how to do any of this?