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? ???
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.