1. No Profile Picture
    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


    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 ?

  2. #2
  3. No Profile Picture
    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 -

Similar Threads

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

IMN logo majestic logo threadwatch logo seochat tools logo