Ok I have 4 select fields where they use ajax to pull in the options for the next select. If I change the first select after I already picked option for all four I want to reset the 3 under it to the first one back to the first option for each select.
so on each select I have onchange I call a my function
setDefault(nameOfDiv);
and my function looks like this.
I don't know very much about javascript so I don't even know if I'm going about this the correct way. I hope I explained what i'm trying to do well enough. Any help is really appreciated. thanksCode:function setDefault(div) { var priceID = document.getElementsByName('price'); var makeID = document.getElementsByName('make'); var modelID = document.getElementsByName('model'); if(div = 'type') { priceID.selectedIndex = 0; makeID.selectedIndex = 0; modelID.selectedIndex = 0; /*priceID.selected = priceID.item(1); makeID.selected = makeID.item(1); modelID.selected = modelID.item(1);*/ } if(div = 'price') { makeID.selected = makeID.item(1); modelID.selected = modelID.item(1); } if(div = 'make') { modelID.selected = modelID.item(1); } }



Reply With Quote
Bookmarks