Solved

Showing layer with list menu

Posted on 2006-11-07
4
129 Views
Last Modified: 2010-04-25
Hi everyone, I always post on here whenever I'm really stuck - and I'm really stuck again, so I hope someone can help!

I have a list box with certain options in in. My last option at the bottom of the list menu is called "Other".

This works fine, no problems.

What I'd like to happen is for a text box to appear when I select 'Other' (into which I can type my free-text, "Other" category.

So far, I have figured out how to show and hide layers.... but the show/hide behavoiur is, by deafult, applied to the WHOLE list menu - which means the text box is displayed when ANY of the  options are selected...

Does anyone know how to get this to work?

Thanks!
0
Comment
Question by:jamesEE
  • 2
4 Comments
 
LVL 16

Expert Comment

by:CWS (haripriya)
ID: 17895760
Do you want to make a textbox visible and invisible based on the option selected in the list?

Can u post your working code?
0
 
LVL 25

Accepted Solution

by:
Rouchie earned 125 total points
ID: 17896249
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript">
function ShowIt(menuValue){
      if(menuValue=='Other'){
            document.getElementById('myText').style.visibility = 'visible';
      } else {
            document.getElementById('myText').style.visibility = 'hidden';
      }
}
</script>
</head>
<body>
<form id="myform" name="myform" action="somepage.html" method="post">
<select id="dropDown" onChange="javascript: ShowIt(document.getElementById('dropDown').value);">
        <option value="0">Some option</option>
      <option value="1">Another option</option>
        <option value="Other">Other</option>
</select>

<br/><br/>
<input type="text" id="myText" name="myText" style="visibility:hidden;" />
</form>
</body>
</html>
0
 
LVL 2

Author Comment

by:jamesEE
ID: 17899334
GREAT!

Works like an absolute charm, many many thanks, Rouchie

Really appreciate your help

0
 
LVL 25

Expert Comment

by:Rouchie
ID: 17899415
You're welcome!
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question