Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Need Help with Else Statement

Reply
Thread Tools

Need Help with Else Statement

 
 
Steve Bishop
Guest
Posts: n/a
 
      02-01-2004
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="h idden"
document.getElementById("but1").style.visibility=" hidden"
document.getElementById("Table2").style.visibility ="visible"

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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
F. Da Costa
Guest
Posts: n/a
 
      02-01-2004
Steve Bishop wrote:

> 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="h idden"
> document.getElementById("but1").style.visibility=" hidden"
> document.getElementById("Table2").style.visibility ="visible"
>
> }

else {
// whatever you need to do here.
}
> </SCRIPT>
> </HEAD>
> <BODY onLoad="showtable()";>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
else if vs else { if A C++ 8 08-28-2010 08:55 PM
What's the use of the else in try/except/else? kj Python 15 05-23-2009 02:18 AM
for: else: - any practical uses for the else clause? metaperl.etc@gmail.com Python 25 09-30-2006 11:01 PM
ruby idiom for python's for/else while/else Gergely Kontra Ruby 16 09-20-2005 08:35 PM
Which of switch statement and if-else statement takes less time to execute? swaroophr@gmail.com C Programming 21 08-02-2005 09:24 AM



Advertisments