Need Help with Else Statement

Discussion in 'Javascript' started by Steve Bishop, Feb 1, 2004.

  1. Steve Bishop

    Steve Bishop Guest

    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()";>

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Steve Bishop, Feb 1, 2004
    #1
    1. Advertising

  2. Steve Bishop

    F. Da Costa Guest

    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="hidden"
    > 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!
     
    F. Da Costa, Feb 1, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    25
    Views:
    694
    MonkeeSage
    Oct 1, 2006
  2. Replies:
    21
    Views:
    1,078
    Giannis Papadopoulos
    Aug 2, 2005
  3. kj
    Replies:
    15
    Views:
    591
    Lawrence D'Oliveiro
    May 23, 2009
  4. A
    Replies:
    8
    Views:
    827
    James Kanze
    Aug 28, 2010
  5. Gergely Kontra
    Replies:
    16
    Views:
    246
    Devin Mullins
    Sep 20, 2005
Loading...

Share This Page