Jump to content

Onchange event for multiple drop downs


sazzie

Recommended Posts

[quote author=fenway link=topic=124884.msg518140#msg518140 date=1170264016]
Then only put the onchange on the second one, and have it check for a valid "first" input.
[/quote]

Thanks. That makes sense. Can you advise on how I check for the "valid first entry"?

Also, my form select element has an onchange function attached to it:

[code]
<form method="post" action="" >
<select name="month" id="select_month" onChange="test();">
................
[/code]

I use a separate pair of images to scroll through the months in both directions using the function below:

[code]
function scroll(dir)
{
var elementID=document.getElementById("select_month");

if( dir == 0 )
{
if( elementID.selectedIndex-1 >= 0 )
elementID.selectedIndex-=1;
}
else
{
if( elementID.selectedIndex+1 <= 11 )
elementID.selectedIndex+=1;
}
}
[/code]

What I need is to get my scroll function to respond to onChange=test() just as my select drop downlist input element.

Can you help please? ???

Archived

This topic is now archived and is closed to further replies.

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