SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast 1magic's Avatar
    Join Date
    Jan 2002
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Process a SELECT MULTIPLE [POST]

    I have a problem with processing a Select Multiple:

    Code:
    <form method=POST...>
    <select name='region' multiple>
    <option value=1> bla bla
    <option value=2> bla bla
    <option value=3> bla bla
    </select>
    </form>
    When selected more than one option, the form sends only one value (of the last selected)
    region=3
    It is not even an array. I am stuck here, damn. I thought this would be simple and clear, but not.
    What to do?!? I can't use checkboxes because I'll have many choices.

    Any suggestions?
    You will appreciate Bulgaria's dramatic mountains, haven-like monasteries, Roman and Byzantine ruins, and the excellent coffee you'll be offered wherever you go! -- read more!

  2. #2
    Dinah-Moe Humm mudshark's Avatar
    Join Date
    Dec 2003
    Posts
    1,072
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi. This:
    Code:
    <select name="region[]" multiple>
    ...should give you the $post values in an array.

  3. #3
    SitePoint Enthusiast 1magic's Avatar
    Join Date
    Jan 2002
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    worked. thanks a lot.
    You will appreciate Bulgaria's dramatic mountains, haven-like monasteries, Roman and Byzantine ruins, and the excellent coffee you'll be offered wherever you go! -- read more!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •