sub select box

Discussion in 'Programming' started by roice, Mar 2, 2011.

  1. #1
    Hello,
    I have DB of category (id, name) and DB of sub_category (id, category_id, name)
    I want to do select box for sub_category that will be changed according to the "category" box.
    I mean - if I'm choosing the second category I will see different options on the sub category box.

    Can you please help me with that?
     
    roice, Mar 2, 2011 IP
  2. roice

    roice Peon

    Messages:
    200
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    roice, Mar 2, 2011 IP
  3. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #3
    If you are going to do it with the database then it is most likely sensible to do it with Ajax.

    A simple postback once the first one has been selected and then populate the second drop down with the db query result. Googling cascading drop down menu + your preferred language should give you an example
     
    AstarothSolutions, Mar 3, 2011 IP