Need Help with Else Statement

S

Steve Bishop

Could someone tell me the syntax for using "else' to check the value of
my txtName1 value if its not "Size Mix". If it is not size mix I want to
hide the table "Table2" and show the other controls I hid. Help
appreciated. Thanks.
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function showtable(){
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"

}
</SCRIPT>
</HEAD>
<BODY onLoad="showtable()";>
 
F

F. Da Costa

Steve said:
Could someone tell me the syntax for using "else' to check the value of
my txtName1 value if its not "Size Mix". If it is not size mix I want to
hide the table "Table2" and show the other controls I hid. Help
appreciated. Thanks.
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function showtable(){
var myform1 = document.form1
var myform2 = document.form2
if (myform1.txtName1.value =="Size Mix")
Start by adding a { here
document.getElementById("tn3").style.visibility="hidden"
document.getElementById("but1").style.visibility="hidden"
document.getElementById("Table2").style.visibility="visible"

}
else {
// whatever you need to do here.
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top