SQL Server Performance

Changes values in a <select> depend of DB

Discussion in 'General Developer Questions' started by bomaye, Sep 3, 2003.

  1. bomaye New Member

    Hello,

    i'm doing a web page with php where can insert data in a form and i insert that in a mssql. but i have two <select> html tags, than one depends in other, and i want to know how i can sow the data in the second select depending on the selected in the first.

    i know how to sow the data in the <select> taking it from the mssql. but in the second i want than when you select an option in the first, this changes and sow the data in with row of the table find this value.

    Thanks.
  2. trifunk New Member

    Hi there,

    You'll need to attach some javascript to the first select html control, use the 'onchange' event of the control to fire off some javascript to repost the form, in the php pick up the selected option in the first html control and query the database for the relevant items to go into the second html control.

    You can find more about this kinda thing athttp://www.webmonkey.com

    Cheers
    Shaun

    World Domination Through Superior Software
  3. Chappy New Member

    I did a similar thing on a website I created. Check out the script behind the two combos on the front page

    http://www.onlinecoins.co.uk

    Of course, depending on the total number of entries you might need to display, you may prefer to look into using XML to populate the second select on the fly.

Share This Page