delphi programming forums mysql charset mget recursive synonimos
free ventrilo servers hosting cs javascript delay python find in list
Back Forum New
abstract:

<option value="tet3">tesestt3</option>
<option value="tet4">esttestest4</option>
<option value="tet5">testesestt5</option>
<option value="tet6">testest36</option>
<option value="tet7">testest37</option>
<option value="tet8">testest38</option>
</select>
Any insight ....??


Hi,
I am trying to use the multiple attribute with a select listbox -  i have it looking ok but when i check the passed values i only see the last item chosen. I thought the point of multiple was to send a comma separated list of values to the server.
I read that multiple does not work with all browsers - i develop and check my markup in 5 primary browsers (IE, FF, Moz, NN, Opera) but multiple doesn't seem to work in any of them!!!
This is my select:
Code:
  1. <select name="lstAddToViews" size="4" multiple="multiple" class="listmenu">
  2. <option value="test2">tsestestt2</option>
  3. <option value="tet3">tesestt3</option>
  4. <option value="tet4">esttestest4</option>
  5. <option value="tet5">testesestt5</option>
  6. <option value="tet6">testest36</option>
  7. <option value="tet7">testest37</option>
  8. <option value="tet8">testest38</option>
  9. </select>
Copy Code
Any insight ....??

TOP

copied and pasted exactly, it works fine for me. You may also try just using:
Code:
  1. <select name="lstAddToViews" size="4" multiple class="listmenu">
Copy Code
Make sure you've got the <form></form> tags around this.
If you still have a problem, can you post more code?
:grimey

TOP

You have to set the name attribute to an array, else each value over-writes the previous.
Code:
  1.   <form action="action.php"
  2.         method="get">
  3.     <select name="test
  4. []
  5. "
  6.           multiple="multiple">
  7.       <option>
  8.         item1
  9.       </option>
  10.       <option>
  11.         item2
  12.       </option>
  13.       <option>
  14.         item3
  15.       </option>
  16.     </select> <input type="submit"
  17.           value="enter" />
  18.   </form>
  19. =============
  20. <?php
  21. $key = $_GET['test'];
  22. foreach ($key as $value) {
  23.    echo '<p>'. $value.'<p>';
  24. }
  25. ?>
Copy Code
cheers,
gary

TOP


Originally Posted by Frank Grimes
copied and pasted exactly, it works fine for me. You may also try just using:
Code:
  1. <select name="lstAddToViews" size="4" multiple class="listmenu">
Copy Code
Make sure you've got the <form></form> tags around this.
If you still have a problem, can you post more code?
:grimey
If you're writing XHTML Strict you're going to want to keep the
Code:
  1. <select name="lstAddToViews" size="4" multiple="multiple" class="listmenu">
Copy Code
Also, shouldn't size equal the number of rows that you want displayed?

TOP

abstract:

<option value="tet3">tesestt3</option>
<option value="tet4">esttestest4</option>
<option value="tet5">testesestt5</option>
<option value="tet6">testest36</option>
<option value="tet7">testest37</option>
<option value="tet8">testest38</option>
</select>
Any insight ....??



Originally Posted by devinia
Hi,
I am trying to use the multiple attribute with a select listbox -  i have it looking ok but when i check the passed values i only see the last item chosen. I thought the point of multiple was to send a comma separated list of values to the server.
I read that multiple does not work with all browsers - i develop and check my markup in 5 primary browsers (IE, FF, Moz, NN, Opera) but multiple doesn't seem to work in any of them!!!
This is my select:
Code:
  1. <select name="lstAddToViews" size="4" multiple="multiple" class="listmenu">
  2. <option value="test2">tsestestt2</option>
  3. <option value="tet3">tesestt3</option>
  4. <option value="tet4">esttestest4</option>
  5. <option value="tet5">testesestt5</option>
  6. <option value="tet6">testest36</option>
  7. <option value="tet7">testest37</option>
  8. <option value="tet8">testest38</option>
  9. </select>
Copy Code
Any insight ....??
Yes you are right, the results could be returned as a list (CSV). This is all depending on the Server side language that you wish to use. as kk5st stated if you are using php, you will have to declare the "name" attribute as an array. But i know with coldfusion you do not need to do anything and the results will return with a simple list that you can loop thought with cfloop. Hope this helps.

TOP

Back Forum