ClueLess
12-31-2002, 09:08 PM
I would like to HIDE the table at first time loading. How can I do that? Because, first time loading, the dropdown list is CASE 0; if it is case 0, the table SHOULD NOT be shown.
The code works fine (show and hide table) when I select a diff. cases from a dropdown list…but not at the first time browsing this page. Please see the code below.
Thank you for your help.
<HTML>
<HEAD>
<TITLE>DHTML</TITLE>
<SCRIPT LANGUAGE = "JavaScript">
var isIE = (document.all) ? true : false;
function hideLayer(lay) {
if (isIE)
{
document.all[lay].style.display = "none";
}
}
function showLayer(lay)
{
if (isIE)
{
document.all[lay].style.display = "";
}
}
function changeObjectAppearance(object1)
{
if(document.SubmitForm.selectname.selectedIndex == 4)
showLayer(object1)
else
hideLayer(object1)
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR=#FFFFFF>
<form name="SubmitForm">
<select name="selectname" onchange ="changeObjectAppearance('showbankinfo')">
<option>case 0 - DON'T show table</option>
<option>case 1 - DON'T show table</option>
<option>case 2 - DON'T show table</option>
<option>case 3 - DON'T show table</option>
<option>case 4 - Show table !</option>
</select>
<BR>
Some text
<DIV class="class1" ID="showbankinfo" name="showbankinfo">
<table border="0" cellpadding="1" cellspacing="1">
<tr>
<td class="smallHeadingBurg" align="right" name="Name"></font>Name</td>
<td class="regularParagraph">
<input type="text" size="30" maxlength="9" name="name" id="name" value="">
</td>
</tr>
<tr>
<td class="smallHeadingBurg" align="right">Phone:</td>
<td class="regularParagraph">
<input type="text" size="30" name="phone" id="phone" value="">
</td>
</tr>
</table>
</div>
</form>
</BODY>
</HTML>
The code works fine (show and hide table) when I select a diff. cases from a dropdown list…but not at the first time browsing this page. Please see the code below.
Thank you for your help.
<HTML>
<HEAD>
<TITLE>DHTML</TITLE>
<SCRIPT LANGUAGE = "JavaScript">
var isIE = (document.all) ? true : false;
function hideLayer(lay) {
if (isIE)
{
document.all[lay].style.display = "none";
}
}
function showLayer(lay)
{
if (isIE)
{
document.all[lay].style.display = "";
}
}
function changeObjectAppearance(object1)
{
if(document.SubmitForm.selectname.selectedIndex == 4)
showLayer(object1)
else
hideLayer(object1)
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR=#FFFFFF>
<form name="SubmitForm">
<select name="selectname" onchange ="changeObjectAppearance('showbankinfo')">
<option>case 0 - DON'T show table</option>
<option>case 1 - DON'T show table</option>
<option>case 2 - DON'T show table</option>
<option>case 3 - DON'T show table</option>
<option>case 4 - Show table !</option>
</select>
<BR>
Some text
<DIV class="class1" ID="showbankinfo" name="showbankinfo">
<table border="0" cellpadding="1" cellspacing="1">
<tr>
<td class="smallHeadingBurg" align="right" name="Name"></font>Name</td>
<td class="regularParagraph">
<input type="text" size="30" maxlength="9" name="name" id="name" value="">
</td>
</tr>
<tr>
<td class="smallHeadingBurg" align="right">Phone:</td>
<td class="regularParagraph">
<input type="text" size="30" name="phone" id="phone" value="">
</td>
</tr>
</table>
</div>
</form>
</BODY>
</HTML>