SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: list selection

  1. #1
    SitePoint Guru
    Join Date
    Apr 2001
    Location
    BC, Canada
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey all, This question kinda doesnt belong here... and it kinda does.. Im using one of those drop down boxes to pass a variable in a form so I can update via mysql.

    using this...

    <select name="premium" size="1">
    <option selected>yes
    <option>no
    </select>

    now.. when this is submited.. how will the info be stored.. will it be in a variable $premium witht he value of either yes or no ?

    thanx

  2. #2
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think if you want it to be in a PHP variable named $premium, and to have values of "yes" or "no" depending on what the user chose, you would need this HTML:

    <select name="premium" size="1">
    <option value="yes" selected="selected">yes</option>
    <option value="no">no</option>
    </select>

  3. #3
    SitePoint Guru
    Join Date
    Jan 2001
    Location
    Alkmaar, Netherlands
    Posts
    710
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    slighltywhacked: your code is okey you dont have to make any changes, because $premium will be yes or no according to which select is chosen in the form and then submitted.
    And there is no need to enter VALUES in OPTION(even though I usually enter values because they are different from what I show the user to select)

  4. #4
    SitePoint Guru
    Join Date
    Apr 2001
    Location
    BC, Canada
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    heh damn.. already changed about 150 lines .. little late

    thanx anyways


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
  •