Jump to content

Drop Down Box


pucker22

Recommended Posts

Hello phpfreaks,

 

I'm trying to code a piece of script, whereby when someone selects their location, through a drop down box, it will print out another box with a city, for example

 

<Drop Down Box>

United States

United Kingdom

 

If United States is selected then echo another drop down box.

 

Is someone able to help me?

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/113632-drop-down-box/
Share on other sites

i've done it both ways.  Javascript is the toughest especially if you are pulling data from a database, but AJAX does make it 'easier'.  Easiest way is to just add a onchage=this.form.submit() to the first select box, have the form action call the parent page and have code that catches the selected value and populates the second box.

 

Having done it both ways, on a fast connection, I have yet to see a difference in performance between the two methods.

Link to comment
https://forums.phpfreaks.com/topic/113632-drop-down-box/#findComment-583947
Share on other sites

Thanks for the responce,

 

The tutorial seems to be pulling information from a database, rather than just having a php page whereby if you select a county, it will then echo some text, for example,

 

<Drop Down Box>

United States

 

Then when the user selects United States it will produce this:

 

echo ' you selected united states '

 

Is this possible?

 

Thanks again!

Link to comment
https://forums.phpfreaks.com/topic/113632-drop-down-box/#findComment-583954
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.