Related dropdowns and loading div

I'm a little new when it comes to programming, but I'm trying to learn. What I need to do for my site, there are 2 or 3 related drop-down menus, so when I select an item from the first, the second will be updated with other options. I found a way to do this using java, but I can't do it using the div refresh part. I was looking for prototypejs / updater, but it is a little over my head and may not seem to be related to javascript, which I used for dropdown menus ...

So, if someone can say how I can link two, maybe 3 drop-down menus, and after I click on the button from the last menu, make a div with page refresh with other content, please help :)

+3
source share
2 answers

Not 100% sure you are after this, but I think this should help you, at least in some ways:

http://remysharp.com/2007/09/18/auto-populate-multiple-select-boxes/

Its a jquery plugin for linking select blocks together, using ajax to load data to populate the next field in the chain based on the value selected in the previous one.

Then you will need to bind the last field to the div, but you should be able to do this using a similar method yourself - see the jquery ajax documentation.

http://docs.jquery.com/Ajax

+2
source

google , , , .

, "onchange", .

:

<select id="select1" name="option">
</select>

javascript:

var sel1 = document.getElementById("select1");
sel1.onchange = function() {
  //do whatever you want
};

, div

+2

All Articles