JavaScript noob lost with if statement
<p>this is myFunctions code but it doesn't work. actually its beginner code cause i self teach what i can as i go. all variable are declare before the function</p>

<p>Original coded edited out.</p>

<p>it keeps going till all tubing size and weights from a table i have are filled in. it only works when i have 1 if statement. guess what i m asking is whats wrong with it. and is there an easier way to do this. i have more table for different things like casing of wellbore.</p>

<p>this won't work</p>

<pre><code>&lt;head&gt;
    &lt;title&gt;Well Service Prevention&lt;/title&gt;
    &lt;script&gt;
        var tubingSize;
        var tubingWeight;
        var tubingDisplacement;
        var tubingCapacity;
        function tubingTables(frm){
            if (frm.tubingSize.value == 50.8){
                tubingSize = 50.8
                tubingWeight = 5.06
                tubingDisplacement = 0.00065
                tubingCapacity = 0.001413
                alert("Tubing ID: " + tubingSize)
            }
            if (frm.tubingSize.value == 52.4){
                tubingSize = 52.4
                tubingWeight = 4.84
                tubingDisplacement = 0.000622
                tubingCapacity = 0.001554
                alert("Tubing ID: " + tubingSize)
            }
            if (frm.tubingSize.value == 60.3 &amp;&amp; frm.tubingWeight.value == 5.95){
                tubingSize = 60.3
                tubingWeight = 5.95
                tubingDisplacement = 0.000765
                tubingCapacity = 0.00211
                alert("Tubing ID: " + tubingSize "Tubing Weight:" + tubingWeight)
            }
        }
    &lt;/script&gt;

&lt;/head&gt;
&lt;body&gt;
    &lt;form name=known&gt;
        &lt;h3&gt;
            Enter Known
        &lt;/h3&gt;
        &lt;p&gt;Tubing ID: &lt;input type="number" name="tubingSize"&gt;
        &lt;p&gt;Tubing Weight: &lt;input type="number" name="tubingWeight"&gt;
        &lt;p&gt;Tubing Displacement: &lt;input type="number" name="tubingDisplacement"&gt;
        &lt;p&gt;Tubing Capacity: &lt;input type="number" name="tubingCapacity"&gt;
        &lt;input type="button" value="Debug" onclick="tubingTables(this.form)"&gt;
    &lt;/form&gt;
&lt;/body&gt;
</code></pre>

<p>remove last if statement it works.</p>

<pre><code>&lt;head&gt;
    &lt;title&gt;Well Service Prevention&lt;/title&gt;
    &lt;script&gt;
        var tubingSize;
        var tubingWeight;
        var tubingDisplacement;
        var tubingCapacity;
        function tubingTables(frm){
            if (frm.tubingSize.value == 50.8){
                tubingSize = 50.8
                tubingWeight = 5.06
                tubingDisplacement = 0.00065
                tubingCapacity = 0.001413
                alert("Tubing ID: " + tubingSize)
            }
            if (frm.tubingSize.value == 52.4){
                tubingSize = 52.4
                tubingWeight = 4.84
                tubingDisplacement = 0.000622
                tubingCapacity = 0.001554
                alert("Tubing ID: " + tubingSize)
            }
        }
    &lt;/script&gt;

&lt;/head&gt;
&lt;body&gt;
    &lt;form name=known&gt;
        &lt;h3&gt;
            Enter Known
        &lt;/h3&gt;
        &lt;p&gt;Tubing ID: &lt;input type="number" name="tubingSize"&gt;
        &lt;p&gt;Tubing Weight: &lt;input type="number" name="tubingWeight"&gt;
        &lt;p&gt;Tubing Displacement: &lt;input type="number" name="tubingDisplacement"&gt;
        &lt;p&gt;Tubing Capacity: &lt;input type="number" name="tubingCapacity"&gt;
        &lt;input type="button" value="Debug" onclick="tubingTables(this.form)"&gt;
    &lt;/form&gt;
&lt;/body&gt;
</code></pre>

<p>also working on getting a debugger in firefox right now. any sugestions?</p>
