#1
  1. No Profile Picture
    mrtesting
    Guest
    Devshed Newbie (0 - 499 posts)
    <form name=form1 action=process.php>
    <SELECT NAME="toppings" MULTIPLE SIZE=5>
    <OPTION VALUE="mushrooms">mushrooms
    <OPTION VALUE="greenpeppers">green peppers
    <OPTION VALUE="onions">onions
    <OPTION VALUE="tomatoes">tomatoes
    <OPTION VALUE="olives">olives
    </SELECT>

    </form>

    when i select 2 or more items in the select object toppings, there is ONLY ONE value in the form1.toppings.value ie :- olives even if i select both onions and olives.

    how do i pass all the selected values to process.php ?


    Thanks.
  2. #2
  3. No Profile Picture
    jpenix
    Guest
    Devshed Newbie (0 - 499 posts)
    What's happening is that "olives" is overwriting the value "onions" in your variable "toppings" because "toppings" can only contain one value at a time.

    The solution is to use an array. Change your SELECT statement to look like this:

    <SELECT NAME="toppings[]" MULTIPLE SIZE=5>

    See PHP FAQ Section 5.9 -
    http://www.php.net/FAQ.php3#5

Similar Threads

  1. insert a select and custom values
    By naiad in forum MySQL Help
    Replies: 2
    Last Post: February 8th, 2004, 05:28 PM
  2. Compare values of tags of SELECT
    By poison_ivy in forum Java Help
    Replies: 0
    Last Post: February 4th, 2004, 02:44 AM
  3. Replies: 2
    Last Post: January 27th, 2004, 04:34 PM
  4. assigning values by select within a procedure
    By iso in forum MS SQL Development
    Replies: 16
    Last Post: January 21st, 2004, 10:39 AM
  5. select verification onsubmit
    By DrStein in forum HTML Programming
    Replies: 3
    Last Post: January 20th, 2004, 04:16 AM

IMN logo majestic logo threadwatch logo seochat tools logo