Creating pop down navigation boxes

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nfrandsen
Forum Newbie
Posts: 6
Joined: Fri Nov 21, 2008 4:42 am

Creating pop down navigation boxes

Post by nfrandsen »

Hey guys I'm wanting to create a navigation bar on the left hand side of my page. It contains several drop down option boxes such as "state", "city", "suburb". So first the user clicks on state and selects the right one, then when he then clicks city it will contain the cities located in that state and he can select one, and so on for suburbs. Could anyone please explain a little theory about how to do this? are there any good posts on it that you could direct me to? I am developing with the Zend Framework, how should i organize my data. Should i have the option box html in the view script and then pass it the "state", "city", "suburb" values from the controller. As there are quite a few, where should i store them, should they just be hardcoded into the controller or stored in database or in a helper function? If someone could please help explain to me how to design it that would be great.
Thanks everyone for the help!
User avatar
airy
Forum Newbie
Posts: 20
Joined: Fri Jul 11, 2008 2:53 am

Re: Creating pop down navigation boxes

Post by airy »

This is a simple javascript work.
When you select state, javascript will get which one is selected and change the <option> of city

I suggest you to set state and city in a javascript array.
You may find source code in http://www.kejiji.com
Post Reply