title: How to get validation to work properly on my input fields
body: <p>I have managed to get my fields to calculate properly but now I am trying to add some validation to them which is proving difficult. What I aim to do is make sure that the fields have to contain numbers only and have to be filled in.</p>
  
  <pre><code>function audience_details()
  if(fields.length === 0) {
       var aud1, aud2, total;
       var aud1 = parseInt(document.getElementById("audience_1_field").value);
       var aud2 = parseInt(document.getElementById("audience_2_field").value);
       var reach = parseInt(document.getElementById("reach_field").value);
       var total = (aud1 + aud2 - reach ) / aud1 * 100 ;
       total_field.value =  parseFloat(total).toFixed(2) + '%';
       estimate.value =  parseFloat(total).toFixed(2) + '%';
  }
  else {
       //alert fields must be complete / contain numbers only!
  }
  </code></pre>
  
  <p>any help would be lovely here is the form <a href="http://jsfiddle.net/pjf2v7b8/" rel="nofollow">http://jsfiddle.net/pjf2v7b8/</a></p>