title: "Try...Catch" Block not Working with parseInt()
body: <p><strong>What I'm trying to do:</strong></p>
  
  <p>I have a javascript program that, when a button is clicked, takes in 4 strings from 4 text boxes in a form, and outputs those strings into a formatted textarea.</p>
  
  <pre><code>function testResults(form){
  var errorhandle1 = parseInt(document.myForm.Item_Code.value);
  var errorhandle2 = parseInt(document.myForm.Item_Cost.value);
  var errorhandle3 = parseInt(document.myForm.Quantity.value);
  //above variables are for error handling.
  var d = "   ";
  var subtotal = parseInt(form.Item_Cost.value) * parseInt(form.Quantity.value);
  var subtotalValue = parseInt(document.myForm.Subtotal.value);
  var testVar = "Item Code: " + form.Item_Code.value + d + 
                "Item Name: " + form.Item_Name.value + d + 
                "Item Cost: " + form.Item_Cost.value + d + 
                "Quantity: " + form.Quantity.value + '\n';
  
  
  document.myForm.myTextarea.value += testVar;
  document.myForm.Subtotal.value = parseInt(subtotal) + subtotalValue;
  document.myForm.Sales_Tax.value =  document.myForm.Subtotal.value * salestax;
  document.myForm.Total.value = parseInt(document.myForm.Subtotal.value) + parseFloat(document.myForm.Sales_Tax.value);
  }
  </code></pre>
  
  <p>The above code works just fine, and does exactly what I want it to do for the scope of my program.</p>
  
  <pre><code>try {
      if ((isNaN(errorhandle3) == true) || (isNaN(errorhandle2) == true)) {
          throw "Error1";
      }
  } catch (e) {
      if (e == "Error1") {
          alert("Error! You must enter a number into the qty and cost fields!");
      }
  }
  </code></pre>
  
  <p>What I'm trying to accomplish with the try...catch block is simply to make sure that</p>
  
  <pre><code>document.myForm.Item_Code.value
  document.myForm.Item_Cost.value
  document.myForm.Quantity.value
  </code></pre>
  
  <p>are actually numbers.</p>
  
  <p>The try...catch statements trigger every time I run the program and doesn't care what I put in the corresponding text boxes. I would greatly appreciate any and all insight on this!</p>
  
  <p>Also: I looked at both of these links and was unable to understand my problem.
  <a href="https://stackoverflow.com/questions/6736476/javascript-parseint-return-nan-for-empty-string">javascript parseInt return NaN for empty string</a>
  <a href="http://www.w3schools.com/jsref/jsref_isnan.asp" rel="noreferrer">http://www.w3schools.com/jsref/jsref_isnan.asp</a></p>