Solved

easy css problem

Posted on 2004-04-15
2
216 Views
Last Modified: 2010-04-06
hi im trying to show an other box when a user selects other form the list box.. this doesnt work any help would be greatly appreciated..

    <td width="289" align="left" valign="middle"><select name="referrer">
<option value="Yellow Pages On-Line" onClick="document.getElementById('hideother').style.display='none';">Yellow Pages On-Line</option>
<option value="Yellow Pages" onClick="document.getElementById('hideother').style.display='none';">Yellow Pages</option>
<option value="Referred by a friend" onClick="document.getElementById('hideother').style.display='none';">Referred by a friend</option>
<option value="Referred by a colleague" onClick="document.getElementById('hideother').style.display='none';">Referred by a colleague</option>
<option onClick="document.getElementById('hideother').style.display='';">Search Engine</option>
<option onClick="document.getElementById('hideother').style.display='';">Magazine</option>
<option value="Trade Show">Trade Show</option>
<option onClick="document.getElementById('hideother').style.display='';">Other</option>
                        </select></td><td id="hideother" style="display: none;"><input type="text" name="referrer" size="20"></td>
0
Comment
Question by:chizzy60
2 Comments
 
LVL 4

Accepted Solution

by:
monolith_888 earned 55 total points
ID: 10838991
Here you go chizzy, use this - a muc simpler and streamlined approach to achieve your results

-hth
monolith_888
==================:

<html>
<head>
<title>Hide Other Box</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script>
function checkList()
      {
      var theFormSelect = document.myForm.referrer;
      var otherTextFld = document.getElementById('hideother');

      if(theFormSelect.options[theFormSelect.options.selectedIndex].value == 'Other')
            otherTextFld.style.display = "";
      else
            otherTextFld.style.display = "none";
      }
</script>
</head>

<body>
<form name="myForm">
<table><tr>
<td align="left" valign="middle">
<select name="referrer" onChange="checkList()">
<option value="Yellow Pages On-Line">Yellow Pages On-Line</option>
<option value="Yellow Pages">Yellow Pages</option>
<option value="Referred by a friend">Referred by a friend</option>
<option value="Referred by a colleague">Referred by a colleague</option>
<option value="Search Engine">Search Engine</option>
<option value="Search Engine">Magazine</option>
<option value="Trade Show">Trade Show</option>
<option value="Other">Other</option>
</select>
</td>
<td><input type="text" name="referrerTxt" size="20" id="hideother" style="display:none;"></td>
</tr></table>
</form>
</body>
</html>
0
 

Author Comment

by:chizzy60
ID: 10839411
i ended up working it out similar to that.. but i had to make the display set to block to work on ie. and safari

thanks
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
It's sometimes a bit tricky to use date functions in Oracle BPEL. I'll explain quickly how you can add N days to the current date. In a BPEL process this can be useful, and you can adapt it to fit your needs. First of all, let's see how to add 1 …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

809 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