Head-Fi.org › Forums › Misc.-Category Forums › Members' Lounge (General Discussion) › Help with javascript.. urgent
New Posts  All Forums:Forum Nav:

Help with javascript.. urgent

post #1 of 2
Thread Starter 

I have a basic java assignment due in a couple hours and I need some help debugging this code.. I can't for the life of me figure out why this is not working, I've spent the last hour or so trying to get it to work. It's a very simple script, or at least it's supposed to be.. The point of it is to enter your height in inches, and show the corresponding mountain bike size (roughly). Can someone help me out ASAP? :)

 

    <html>
    <head>
    <title> Bike Sizing </title>
    <script type="text/javascript">


    function siz()
    {
    if (height >= 76){
    document.size.display_siz.value = "22 in (mountain)";
    }
    else if (height >= 72){
    document.size.display_siz.value = "20.5 in (mountain)";
    }
    else if (height >= 68){
    document.size.display_siz.value = "19 in (mountain)";
    }
    else if (height >= 64){
    document.size.display_siz.value = "17 in (mountain)";
    }
    else{
    document.size.display_siz.value = "15 in (mountain)";
    }
    }
    </script>

    </head>

    <body>
    <form name="size">
    <table >
    <tr>
    <td>
    Height in Inches:
    </td>
    <td>
    <input type="text" size=15 name="height" />
    </td>
    </tr>

    <td colspan = 2 >
    <input type="button" value = "Calculate Size"size=15 onClick="siz();" />

    </td>
    </tr>

    <tr>
    <td>Size:
    </td>
    <td>
    <input type="text" size=15 name="display_siz" />
    </td>
    </tr>
    </table>
    </form>


    </body>
    </html>

post #2 of 2
Thread Starter 

Nevermind, got it figured out, thanks to my girlfriend :)

New Posts  All Forums:Forum Nav:
  Return Home
Head-Fi.org › Forums › Misc.-Category Forums › Members' Lounge (General Discussion) › Help with javascript.. urgent