Solved

Showing layer with list menu

Posted on 2006-11-07
4
131 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

739 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