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

hide div until listbox option

Status
Not open for further replies.

onressy

Programmer
Joined
Mar 7, 2006
Messages
421
Location
CA
Hi my issue surrounds displaying the DIV issues when option (99) other is selected, Any suggestions?

I hope my logic is not flawed :?


<script type="text/javascript">
function toggle(id) {
var s = document.getElementById(id).style;
s.display = (s.display == "block" ? "none" : "block");
}
</script>

<style>
.toggle {
display: none;
}</style>

<select name="<%= strTagName %>" class="bodytxt"

onChange="if(document.getElementById('<%=strTagName%>').value=99){toggle('contact');}">

<option value="0"></option>

<%
' use asp to write out some listbox values
%>

<option value="99">Other</option>

</select>

<div id="contact" class="toggle">
<input type="text" name="choicetext" size="20">
</div>


/////Any suggestion? Thanks

 
>[tt]onChange="if(document.getElementById('<%=strTagName%>').value=99){toggle('contact');}"[/tt]
[tt]onChange="if([blue]this[/blue].value[red]=[/red]=99){toggle('contact');}"[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top