Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

drop down menus

Status
Not open for further replies.

mrobinson

MIS
Oct 11, 2002
36
GB
I am having trouble creating a form with a 3 drop down menu's where the values in the menu's are all from a database and after a value is selected in the first menu it narrows down the number of options in the second box and then for the third. I have tried doing this with three different forms but the selected item in the menu is not being passed over. Please could someone help by telling me if it is possible to do on one page with out getting too difficult as i am a beginner trying to teach it to myself. If not what would be the best approach over three different forms? Is there any tutorials on the web that may help?

thanks for any help
 
What you want to do involves the use of PHP to populate dropdowns and the use of JavaScript to automatically submit forms when the dropdowns are changed.

What I did is produce a single PHP script that when run with no form inputs, produces a form with one dropdown; when run with the first dropdown's input, produces a form with two dropdowns; when run with the input from two dropdowns, produces a form with three dropdowns. When it gets input from all three dropdowns, it does some other action.

Also, the script used PHP session variables to record the choice from each dropdown. That way, should a user have selected a value from the first and second dropdowns (thus showing all three dropdowns), but then changes the value of the first dropdown, the PHP script knows to "back up" a step in producing the form.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top