0

Hey there,
I am looking to have 2 drop down lists, 1 for provinces and 1 for cities.
i saw some examples in java script but since i dont know how to use java and i do know and LOVE php i wondering if anyone can help me with this

Thank you,

4
Contributors
6
Replies
8
Views
6 Years
Discussion Span
Last Post by oree
0

<select name="city">

<option value="london">london</option>
<option value="paris">paris</option>
<option value="new york">new york</option>

</select>

this will give you a dropdown box with citys, just add a new option line for each new entry, the whole dropdown box is called "city", this is what you would use to identify or call the option thats selected. ..this dropdown box would all have to sit inside a form which will be submitted to the database.

Edited by IWDesigns: n/a

0

Not sure i explained myself correctly,i am looking to have 2 drop down lists, 1 with provinces/states and the other with the corresponding cities in that province. example:
Toronto will show up when i choose ontario. or Los Angeles will be an option if the state is California. I cant have Toronto in California.

0

thank you, so complicated i will have to think of something easier:)

0

Sorry, was late in with this. A php solution will require Ajax OR a page refresh on 1st dropdown select.

JS only solution is easy if you don't want to store the dropdown data in a DB.

The Ajax solution is EASY with jquery. Still interested?

0

thanks for the will to help i actually got around this by prompting the user before for a province and city.
took the long way around :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.