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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to make a list menu with different actions

Status
Not open for further replies.

cobalt59

IS-IT--Management
Feb 16, 2006
4
NL
Hello,

I have a problem with a list menu. I want to make it do 2 different things on different option selections. On one i want it to show a layer, on the other it has to do nothing.

So like:

option1 <when selected> show/hide layer (remember value)
option2 <when selected> do nothing (remember value)
option3 <when selected> show/hide layer (remember value)

Any ideas how to fix this?


Regards,

Marcus
 
Oh yea, i forgot to mention.. i want it to work without having the document to refresh if possible.
 
Show us the code you currently have. What HTML are you using?

You mention "list menu" and you show "option" tags in your initial post. Does this mean you are talking about the following type of construct:
Code:
<select name="blah">
 <option value="1">1</option>
 <option value="2">2</option>
 <option value="3">3</option>
</select>
Or are you thinking of this type:
Code:
<ul>
 <li>1</li>
 <li>2</li>
 <li>3</li>
</ul>
Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
I found a way already!

<form name="form1">
<select name="menu1" onChange="if(this.value=='test') { MM_showHideLayers('Layer1','','show') }" ><option value="pipo" selected>unnamed1
<option value="test">dsfdsf</option>
<option value="baddabing">dsfdsf</option>
</select>
</form>

maybe there's more ways to do it but i am a happy man now :)
 
Hi Jeff,

I have found a way already as stated above, but thanks anyway!

regards,

Marcus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top