Solved

Showing layer with list menu

Posted on 2006-11-07
4
127 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
This video discusses moving either the default database or any database to a new volume.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now