S
Steve Bishop
I am trying to check for a fields value on load and hide certian
controls based on it's value. I am having trouble with the "else"
statement and the bracket placement. Help appreciated. Here is the code:
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function HideTable(){
var myform1 = document.form1
var myform2 = document.form2
if (myform1.txtName1.value == "Size Mix")
document.getElementById("tn3").style.visibility="hidden";
document.getElementById("but1").style.visibility="hidden";
document.getElementById("Table2").style.visibility="visible";
else
document.getElementById("tn3").style.visibility="visible";
document.getElementById("but1").style.visibility="visible";
document.getElementById("Table2").style.visibility="hidden";
}
</SCRIPT>
</HEAD>
<BODY onLoad="HideTable()">
controls based on it's value. I am having trouble with the "else"
statement and the bracket placement. Help appreciated. Here is the code:
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function HideTable(){
var myform1 = document.form1
var myform2 = document.form2
if (myform1.txtName1.value == "Size Mix")
document.getElementById("tn3").style.visibility="hidden";
document.getElementById("but1").style.visibility="hidden";
document.getElementById("Table2").style.visibility="visible";
else
document.getElementById("tn3").style.visibility="visible";
document.getElementById("but1").style.visibility="visible";
document.getElementById("Table2").style.visibility="hidden";
}
</SCRIPT>
</HEAD>
<BODY onLoad="HideTable()">