Hot Swap using Onchange Form

N

Noah

I have seen this technique on a couple websites, but haven't been
clear on how it's done. What I am looking for is to have a form with
x-options. The technique is that when the first option is selected it
auto updates the other options to correspond. For example if I was
looking for specific cities in a state. Once a state is selected I am
only given specific cities. The end result is to combine this with
php and mysql, but I am sure if I understand the javascript aspect I
can run with it. Thanks.
 
M

Matt Kruse

Noah said:
For example if I was
looking for specific cities in a state. Once a state is selected I am
only given specific cities.

There are many libraries available to do this - my new one is at
http://www.mattkruse.com/javascript/dynamicoptionlist/

There are issues to consider when using javascript to manipulate option
lists, such as falling back to pure html if javascript is not enabled, but
that may or may not apply in your situation. I'm sure Richard will post a
followup scolding you for wanting to do this at all ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top