Jump to content

conditional drop down boxes


golffinder

Recommended Posts

Hi  would nayone know how to do the following with ajax?

 

I'm completely stuck, what i'm trying to do is create some drop down boxes which pull info from the db , then when someone chooses "Europe" from the first box, it automatically only shows europe countries in the second box, then when they choose the european country in second box all course in that country appear in 3rd box.

 

also there is one other complication in that, if someone chooses "north america" in first box, in second box all north america countries appear, if they choose USA, i then want another box to appear with the "States" in it, then when state choosen , the courses for that state appear,

 

the data is kept in 3 different tables, i have so far 3 boxes pulling in "continent" "countries" & "courses"

 

can anyone help me get this up and running?  i can post here what i have if any help

p.s i'm pretty new to all this and not very good

Link to comment
Share on other sites

Please do post what you have as instead of working abstractly we can use the same names / get a better idea of what's supposed to happen, and do you already have an existing javascript framework (with ajax capabilities) in place such as jquery?

Link to comment
Share on other sites

Since you have already made 3 drop-down boxes, I do not see why you cannot insert a 4th one or, in your case, 1 'US state' box in-between 'countries' and 'cities'. Assuming you have one server routine that handles your requests, also that you pass the identifier of the <div> into which you save the result code to the JS routine. When you use "float:left" for these divs, all drop-downs will align nicely next to each other.

 

If this is not the case, please show the code you have developed so far.

 

Ronald

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.