blueindian1
Programmer
hello,
i have this code(simplified):
and this code:
ok, here's the problem. when the page loads, layers One and Two are hidden and Three is visible. clicking on either the 'One' or 'Two' link causes those layers to be shown, but layer 'Three' will not hide. when i click 'One', layer one is shown on top of layer three. when i click two, layer one is hidden and layer two is shown on top of layer three.
now for the tricky part. if i replace the input box in layer three with text, it will then hide itself if the 'one' or 'two' link is clicked. or, if i replace the text in either layer one or two with an input box(or table tags, <br>, or anything), those layers will no longer hide.
what gives?
i have this code(simplified):
Code:
<!-- container.asp -->
<iframe src="source.asp" border="0" height="400" with="100"></iframe>
and this code:
Code:
<!-- source.asp -->
<%
Option Explicit
Response.Buffer=True
%>
<script language="javascript">
function show(obj)
{
// show/hide the divisions
if (obj=='one')
{
alert('called');
document.all['one'].style.visibility = 'visible';
document.all['two'].style.visibility = 'hidden';
document.all['three'].style.visibility = 'hidden';
}
else if (obj=='two')
{
document.all['two'].style.visibility = 'visible';
document.all['one'].style.visibility = 'hidden';
document.all['three'].style.visibility = 'hidden';
}
else if (obj=='three')
{
document.all['three'].style.visibility = 'visible';
document.all['one'].style.visibility = 'hidden';
document.all['two'].style.visibility = 'hidden';
}
}
</script>
<form autocomplete="NO" name="test" method="POST" action="source.asp" target="new">
<table>
<div id="one" style="position:absolute; left:1px; top:1px">
one<br>
one<br>
one<br>
</div>
<div id="two" style="position:absolute; left:1px; top:1px">
two<br>
two<br>
two<br>
</div>
<div id="three" style="position:absolute; left:1px; top:1px">
<tr>
<td>
<input type=text>
</td>
</tr>
</div>
</form>
<!-- run script to hide hotel and auto -->
<script language="javascript">
document.all['one'].style.visibility = 'hidden';
document.all['two'].style.visibility = 'hidden';
document.all['three'].style.visibility = 'visible';
</script>
<tr>
<td colspan="3">
<a href="javascript:show('one');">one</a>
<a href="javascript:show('two');">two</a>
<a href="javascript:show('three');">three</a>
</td>
</tr>
</table>
ok, here's the problem. when the page loads, layers One and Two are hidden and Three is visible. clicking on either the 'One' or 'Two' link causes those layers to be shown, but layer 'Three' will not hide. when i click 'One', layer one is shown on top of layer three. when i click two, layer one is hidden and layer two is shown on top of layer three.
now for the tricky part. if i replace the input box in layer three with text, it will then hide itself if the 'one' or 'two' link is clicked. or, if i replace the text in either layer one or two with an input box(or table tags, <br>, or anything), those layers will no longer hide.
what gives?