Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

One script, multiple drop downs.

Status
Not open for further replies.

scuttleButt

Programmer
May 17, 2000
44
US
I am using javascript for a typical go function. You have a drop down and onchange=go() and

go(){
location=document.conference.brief.options[document.conference.brief.selectedIndex].value
}
normal stuff and it works great until I add another drop down. I guess the same names are messing it up. Is there a way to have in one form 5 or 6 drop downs all called the same thing so that when the user goes to any one of the drop downs it hits that go function? I tried name the drop down brief1, brief2 and doing go(brief1) and then go looks like:
function go(pickme)
{
location=document.conference.pickme.options[document.conference.pickme.selectedIndex].value
}
but that doesn't work either... any suggestions?
 
try replacing onchange="go(pickme)" with onchange="go(this)". In js, this refers to the object at hand

function go(pickme)
{
location=.pickme.options[pickme.selectedIndex].value
} jaredn@eae.net -
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top