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!

dynamic drop down menu

Status
Not open for further replies.

DeepBlerg

Technical User
Jan 13, 2001
224
AU
Hi,

If I have 4 drop down menus in a form, is it possible to dynamically create the content for each menu based on the value selected in the drop down above it.

So, by default each menu would have "ALL" selected, then if the user selected "Option 1" from the first drop down, the second drop down would populate (ON THE FLY - no page reload) with data only applicable to Option 1.

I was thinking if JavaScript can include an external PHP file in a function I could call it on the menu's onChange status and the PHP could return the Javascript?

Is this at all possible??
 
It's possible, but not in the way you're thinking.

JavaScript runs on the web client machine. PHP runs on the server. Javascript can't, then call PHP. But what it can do is at the proper times submit forms (say, when a dropdown changes), then have the PHP script to which the form submits react to the input and recreate the page with each dropdown populated with choices based on on the dropdown before it.



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top