title: Passing a form-variable into the onsubmit field?
body: <p>I am trying to verify the contents of a form before sending it. Basically, I'm trying to work with the numbers in the form and ensure they are within the correct range. The problem is that the JavaScript I have which is trying to verify it thinks that the item being passed to it is NaN (I have been parsing it).</p>
  
  <p>A little work revealed that the variable ("size") is referring to an "HTMLInputEleMent", which I guess is, indeed, NaN (although I am not quite sure what it actually is).  I think that the problem is that the onSubmit is not passing what I want it to be passing, even though I named the field "size" and I passed onSubmit "size" too.</p>
  
  <p>I tried putting it in quotation marks, but that just turns it into a string...</p>
  
  <p>I am wondering if perhaps you are unable to pass a variable from WITHIN the form to it's onSubmit field? Is that so? If so, how should I do this?</p>
  
  <p>Here is the form:</p>
  
  <pre><code>        &lt;form onsubmit="return goodForm(size, day, month, year)" action="http://localhost:8080/pomper_servlet/CostCalc" method="GET"&gt;              
              The day of the month must be entered as a number (ex: 1,22)
              &lt;input type="text" name="day"&gt;&lt;br&gt;
              The month of the year must be entered as a number (ex: Jan.=1, etc.)
              &lt;input type="text" name="month"&gt;&lt;br&gt;
              The year must be entered as a 4 digit number (ex: 2008, 2017)
              &lt;input type="text" name="year"&gt;&lt;br&gt;
              Please Choose a tour-length, in accordance with the chart below:
              &lt;input type="TEXT" name="length"&gt;&lt;br&gt;
              How many people will be in your group? (No More than 10 allowed!)
              &lt;input type="text" name="size"&gt;&lt;br&gt;                
              Please select a tour:&lt;br&gt;
              &lt;input type="RADIO" name="tour" value="Gardiner Lake"&gt;
              Gardiner Lake&lt;br&gt;
              &lt;input type="RADIO" name="tour" value="Hellroaring Plateau"&gt;
              Hellroaring Plateau&lt;br&gt;
              &lt;input type="RADIO" name="tour" value="The Beaten Path"&gt;
              The Beaten Path&lt;br&gt;
              &lt;input type="SUBMIT" value="Submit"&gt;
          &lt;/form&gt;
  </code></pre>
  
  <p>And here is the function, from functions.js:</p>
  
  <pre><code>function goodForm(gSize, day, month, year) {
  "use strict";
  window.alert("goodFrame(): "+gSize);
  var groupSize1 = parseInt( gSize.replace(/^"|"$/g, ""), 10);
  window.alert("goodFrame(): "+groupSize1);
  var sizeInt = parseInt(groupSize1);
  if(groupSize(sizeInt) &amp;&amp; goodDate(day, month, year)){
      window.alert("true");
      return true;
  }
  else{
      window.alert("false")
      return false;
  }
  </code></pre>
  
  <p>There are references to other functions in there, but they aren't relevant to this, I think. The alerts were/are for debugging purposes...</p>
  
  <p>Thanks in advance!</p>