Using forms to Collect data for Javascript functions?
<p>I'm trying to collect data via forms on one page, then transfer that data to the next page for use in a JS function. 
(Specifically, I want the user to input values for A, B, and C of the Quadratic equation, and then send to a page where a script takes those values and runs the equation + outputs an answer). </p>

<p>Here the code for my first page ---> </p>

<pre><code>    &lt;body&gt; 

    &lt;h1&gt; Welcome to the Math Equation Solver &lt;/h1&gt; 

    &lt;p&gt; Which equation would you like to solve? (Simply input the data for the equation you wish to solve). &lt;/p&gt; 

    &lt;form name="quad" method="get" action="JS_B.html"&gt; 

&lt;input 
&lt;input type="text" name="a_val" size="5"&gt; 
&lt;br&gt;
&lt;input type="text" name="b_val" size="5"&gt; 
&lt;br&gt;
&lt;input type="text" name="c_val" size="5"&gt; 
&lt;br&gt;

&lt;input type="submit" method="get" action="JS_B.html" value="Submit"&gt; 

&lt;input type="hidden" name="a_val"&gt; 
&lt;input type="hidden" name="b_val"&gt;
&lt;input type="hidden" name="c_val"&gt; 
&lt;/form&gt; 
</code></pre>

<p>Here is the code for my second page ---> </p>

<pre><code>&lt;title&gt;JS_Math Scripts&lt;/title&gt;


&lt;body&gt; 

&lt;script type="Javascript"&gt; 
function answer()
{
var a = a_val
document.writeln(a_val) 
var b = b_val
var c = c_val
var root = Math.pow(b, 2) - 4 * a * c 
var answer1 = (-b + Math.sqrt(root)) / 2*a 
var answer2 = (-b - Math.sqrt(root)) / 2*a  
     if(root&lt;'0'); 
     {
     alert('This equation has no real solution.')
     }else{
              if(root=='0')
              {          
              answerOne = answer1
          document.writeln(answerOne)
              answerTwo = 'No Second Answer'
              }else{
                   answerOne = answer1
           document.writeln(answerOne)
                   answerTwo = answer2
           document.writeln(answerTwo)
                   }
          }
}
//  End --&gt;
&lt;/script&gt;

&lt;input type="hidden" name="a_val"&gt; 
&lt;input type="hidden" name="b_val"&gt;
&lt;input type="hidden" name="c_val"&gt; 
&lt;input type="hidden" name="answerOne"&gt;
&lt;input type="hidden" name="answerTwo"&gt;
&lt;input type="hidden" name="Answer"&gt;


&lt;/body&gt; 
&lt;/html&gt; 
</code></pre>

<p>So anyways, when I input values for A, B, and C it takes me to the second page, but I'm not getting a result. I've tried inspect element and the console isn't indicating any errors, so I think my data is transferring correctly. Any ideas? </p>