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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP conditional dropdown boxes

Status
Not open for further replies.

lazydays

Technical User
Sep 29, 2003
93
GB
I have 2 drop down lists which are populated by php from a database.
However, I want the second drop down box to be populated depending on what is selected in the 1st box.

I am pretty sure that I can get the 2nd box to populate correctly, but I don't know what function to use to get the page to reload after the value in the 1st drop down box is selected.

I hope this makes sense!

I know this is possible by using javascript, but I have a very limited knowledge of js and would prefer to steer clear!
 
If you want to submit the first drop down automatically to the same page, some very simple js will do the trick.

<select name="first_drop_down" onChange="this.form.submit()">
<option value=1>1</option>
</select>

Your drop down will submit when it is changed.

***************************************
J. Jacobs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top