Im having a bit of a problem and I hope someone could help me out with this.
I have a form in my site which is kind of a survey, and yesterday I decided to enter a new field: "Favorite Bands".
I didnt want to use radio or check boxes so I decided to go with a multiple select box.
So I created the field which is something like this:
<select multiple size="5" name="bands" style="width:150">
<option value="Bon Jovi"> Bon Jovi </option>
<option value="Aerosmith"> Aerosmith </option>
<option value="Metallica"> Metallica </option>
<option value="Pink Floyd"> Pink Floyd </option>
<option value="Toto"> Toto </option>
</select>
I've never used this kind of input before but I thought it would be the same as any field, so I've added the field both in the form and in my CGI:
print FILE "Bands:" . $Input{'bands'};
When i tested the code I saw that the CGI was only writing the first band of the selection and not all of the selected bands, and I cant figure out what Im doing wrong
Can someone help me ot with this....
THANKS
<form action="" method="post">
<select multiple size="5" name="bands" style="width:150">
<option value="Bon Jovi"> Bon Jovi </option>
<option value="Aerosmith"> Aerosmith </option>
<option value="Metallica"> Metallica </option>
<option value="Pink Floyd"> Pink Floyd </option>
<option value="Toto"> Toto </option>
</select>
<input type="submit">
</form><?php
print $bands;
?>
It works. Whats the code your using? PHP code I mean.