Discussion Locked

Javascript dropdown change

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I'm sure this is probably very easy, but...
I have a list of different charts that can be viewed by the user.
Each chart is listed in a select list (there's about 30 charts, the select shows 10 at a time).
Below the main select is a dropdown select.
Each chart has a different initial starting year.
Depending on which chart a person selects, should change the starting year.
Right now I have a chart which has an initial year of 1967. Next to that is a chart that has an initial year of 1978. When I click on the '78 chart, the year drop down switches to 1978, but the years 1967-1977 move to the end of the list (after 2006, then 67-77 show up).
Question: how can I clear that from showing up?

5 replies

by iheatseekeri

//set new values
for (i=0; i < count;i++){
document.chartbook.strtdate.options[i].value=year;
document.chartbook.strtdate.options[i].text=year;
document.chartbook.enddate.options[i].value=year;
document.chartbook.enddate.options[i].text=year;
year++;
}
}

This discussion is closed to new replies.