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

input not showing within div in netscape 4.7

Status
Not open for further replies.

karren

Programmer
Feb 26, 2002
42
CA
hello all,

i am having a problem where the input box will not show within a div tag when i am trying to view it in netscape 4.7.

i am creating a show/hide function, which works fine, but it only shows the text within the div rather than the input box.
anyone know why this would happen?

here is the code:


<script type="text/javascript">
<!--

var ie45,ns6,ns4,dom;
if (navigator.appName=="Microsoft Internet Explorer")
ie45=parseInt(navigator.appVersion)>=4;
else if (navigator.appName=="Netscape"){
ns6=parseInt(navigator.appVersion)>=5;
ns4=parseInt(navigator.appVersion)<5;}
dom=ie45 || ns6;

function showhide(id) {
el = document.all ? document.all[id] :
dom ? document.getElementById(id) :
document.layers[id];
els = dom ? el.style : el;
if (dom){
if (els.visibility == "hidden")
els.visibility = "visible";
else els.visibility = "hidden";
}
else if (ns4){
if (els.visibility == "show")
els.visibility = "hide";
else els.visibility = "show";
}
}



//-->
</script>
</head>

<body bgcolor="#FFFFFF" background="menubk.jpg" >
<form name="form1" action="" method="">
<b>Have
you been audited?</b> &nbsp;&nbsp;&nbsp;Yes
<input type="radio" name="Audited" value="Yes" onClick="javascript: showhide('menu1')"/>
&nbsp; No(<a href="#q2">go to question 2</a>)
<input type="radio" name="Audited" value="No" onFocus="javascript: showhide('menu1')" /><br /><br />

<div id="menu1" style="visibility:hidden;">

<i>If you selected "Yes", please answer the following questions:</i><br /><br />
<b>What year were you notified?</b><br /><input type="radio" name="YearNotified" />
</div>

</form>
</body>
</html>
 
hi Dan,
the style property i have applied for menu one is within the div tag:

<div id="menu1" style="visibility:hidden;">

<i>If you selected "Yes", please answer the following questions:</i><br /><br />
<b>What year were you notified?</b><br /><input type="radio" name="YearNotified" />
</div>

this is a very weird problem and i can't seem to find out anything about it.

 

So there is definately no CSS in any STYLE section being applied to that DIV? In which case, I cannot see why it does not appear.

Have you tried Jeff's suggestion?

Dan

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top