Submit button & Selection boxes

Discussion in 'PHP' started by lost, Dec 20, 2005.

  1. #1
    I have 2 selection boxes. the selection of the first one determines the contents of the second selection box. Once the user has made a selection from both boxes, they need to press the submit button.
    However, once the submit button has been pressed, the contents of the second selection box are reset. how can i keep the contents of the second one set??
     
    lost, Dec 20, 2005 IP
  2. smo

    smo Well-Known Member

    Messages:
    41
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    123
    #2
    You can keep the second drop box ( or first one also ) selected by reading the value from the POST form and then using one if condition to add selected object to the option. You can get an idea on how the two ( or three ) drop down boxes works here.
    http://www.plus2net.com/php_tutorial/php_drop_down_list.php
     
    smo, Dec 23, 2005 IP
  3. BKSH

    BKSH Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You can use the QUERYSTRING to keep track of data in the first selection box. Checking the existance to this querystring you can repopulate data in the second selection box.

    Have fun.
    BKSH;-)
     
    BKSH, Dec 28, 2005 IP