Way to determine if input field has value
<p>I'm re-posting this in an attempt to be more specific in my question. I'm trying to combine the calculators found here: <a href="http://www.nhpta.com/over-tax-calculator.html" rel="nofollow">http://www.nhpta.com/over-tax-calculator.html</a>. </p>

<p>I'd like the calculate button to be smart enough to know whether or not one of two input fields has a value entered and then perform one of two JS functions, Calculate or Calculate2. If both fields have values entered, I'd like it to throw an error in place of the button instead. This is my concept code below, I don't know how to define the php variables nor do I know how to tell it to look at each input field and determine if there has been a value entered. Also not sure if the print is the right?</p>

<pre><code>&lt;?php
    $input_B   = "form field named input_B";
    $input_C  = "form field named input_C";

    if($input_B == 'has a value' &amp;&amp; $input_C == 'has no value')
    { 
        print ' &lt;P&gt;&lt;INPUT TYPE="button" VALUE="Calculate" name="AddButton" onClick="Calculate(this.form.input_A.value, this.form.input_B.value, this.form.input_C.value, this.form)"&gt;&lt;/P&gt;'; 
    } 
    elseif($input_C == 'has a value' &amp;&amp; input_B == 'has no value' )
    { 
        print ' &lt;P&gt;&lt;INPUT TYPE="button" VALUE="Calculate" name="AddButton" onClick="Calculate2(this.form.input_D.value, this.form.input_E.value, this.form.input_F.value, this.form)"&gt;&lt;/P&gt;';
    } 
    elseif ($input_C == 'has a value' &amp;&amp; input_B == 'has a value')
    { 
        print ' Please choose only one field to fill in';
    } 
    else 
    {
        print ' &lt;P&gt;&lt;INPUT TYPE="button" VALUE="Calculate" name="AddButton" onClick="Calculate(this.form.input_A.value, this.form.input_B.value, this.form.input_C.value, this.form)"&gt;&lt;/P&gt;';
    } // End if/else if
?&gt; 
</code></pre>
