Need Help with Else Statement

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve Bishop

    #1

    Need Help with Else Statement

    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="JavaS cript">
    function showtable(){
    var myform1 = document.form1
    var myform2 = document.form2
    if (myform1.txtNam e1.value =="Size Mix")

    document.getEle mentById("tn3") .style.visibili ty="hidden"
    document.getEle mentById("but1" ).style.visibil ity="hidden"
    document.getEle mentById("Table 2").style.visib ility="visible"

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

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
  • F. Da Costa

    #2
    Re: Need Help with Else Statement

    Steve Bishop wrote:
    [color=blue]
    > 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="JavaS cript">
    > function showtable(){
    > var myform1 = document.form1
    > var myform2 = document.form2
    > if (myform1.txtNam e1.value =="Size Mix")
    >[/color]
    Start by adding a { here[color=blue]
    > document.getEle mentById("tn3") .style.visibili ty="hidden"
    > document.getEle mentById("but1" ).style.visibil ity="hidden"
    > document.getEle mentById("Table 2").style.visib ility="visible"
    >
    > }[/color]
    else {
    // whatever you need to do here.
    }[color=blue]
    > </SCRIPT>
    > </HEAD>
    > <BODY onLoad="showtab le()";>
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it![/color]

    Comment

    Working...