title: Getting Values From Form And Using It In JavaScript Function
body: <p>I am having difficulty in simple program...</p>
  
  <p>I have a simple html form from which i get 3 values as integers and then they are submitted to a JavaScript function using this line
  This is the function that i am using</p>
  
  <pre><code>&lt;script language="javascript"&gt;
  function Secured_Rescaled_Marks(form)
  {
      var address = form.total_marks.value;
      window.alert(address);  
      //var secured = (rescale_marks/total_marks)*secured_marks;
      //alert('secured');
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>and this is the form </p>
  
  <pre><code>&lt;form&gt;
  &lt;table cellpadding="3"&gt;
  &lt;tbody&gt;
  &lt;tr&gt;
  &lt;td bgcolor="#6699CC"&gt;
  &lt;b&gt;Total Marks:&lt;/b&gt;
  &lt;input name="text" name="total_marks" /&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;/br&gt;
  &lt;table cellpadding="3"&gt;
  &lt;tbody&gt;
  &lt;tr&gt;
  &lt;td bgcolor="#6699CC"&gt;
  &lt;b&gt;Secured Marks:&lt;/b&gt;
  &lt;input name="text" name="secured_marks"&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;/br&gt;
  &lt;table cellpadding="3"&gt;
  &lt;tbody&gt;
  &lt;tr&gt;
  &lt;td bgcolor="#6699CC"&gt;
  &lt;b&gt; Rescale Marks:&lt;/b&gt;
  &lt;input name="textarea" name="rescale_marks"&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;/br&gt;
      &lt;input type="button" onsubmit="return Secured_Rescaled_Marks(this);" name="order" value="Secured_Rescaled_Marks??"/&gt;
  
  &lt;input type="reset" value="Reset"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I need to calculate such formula on form submission and alert the result....</p>
  
  <pre><code>var secured = (rescale_marks/total_marks)*secured_marks;
  </code></pre>
  
  <p>Any help will be appreciated...</p>