title: Form submission causing 'Maximum call stack size exceeded'
body: <p>I've created a form that is used to review a person on a website, however when the form is submitted nothing happens and console is showing a 'Maximum Call Stack Exceeded'. Hopefully someone can help point out the error in my code stopping this from working. Here is the form code:</p>
  <pre><code> &lt;form id=&quot;fReviewMe&quot; method=&quot;post&quot; action=&quot;/process/review-p.cfm&quot; enctype=&quot;multipart/form-data&quot; style=&quot;display:none&quot;&gt;
      &lt;label style=&quot;padding-top:10px&quot;&gt;&lt;i class=&quot;fa fa-asterisk magenta&quot;&gt;&lt;/i&gt; Your Name:&lt;/label&gt;
      &lt;input type=&quot;text&quot; name=&quot;uname&quot; id=&quot;uname&quot; class=&quot;span8&quot; placeholder=&quot;Please tell us your name&quot;&gt;
      &lt;label&gt;&lt;i class=&quot;fa fa-asterisk magenta&quot;&gt;&lt;/i&gt; Your Business Name:&lt;/label&gt;
      &lt;input type=&quot;text&quot; name=&quot;business&quot; id=&quot;business&quot; class=&quot;span8&quot; placeholder=&quot;Please tell us your business name&quot;&gt;
      &lt;label&gt;&lt;i class=&quot;fa fa-asterisk magenta&quot;&gt;&lt;/i&gt; Your Review:&lt;/label&gt;
      &lt;textarea name=&quot;reviewmsg&quot; id=&quot;reviewmsg&quot; class=&quot;span8&quot; rows=&quot;8&quot; placeholder=&quot;Please add your review in here&quot;&gt;&lt;/textarea&gt;
      &lt;!--- form errors ---&gt;
              &lt;div id=&quot;dFormErrors&quot; class=&quot;row&quot; style=&quot;display:none;padding-bottom:20px;&quot;&gt;
                &lt;span id=&quot;sEMessage&quot; class=&quot;pull-right&quot;&gt;&lt;/span&gt;
                &lt;i class=&quot;fa fa-asterisk magenta pull-right&quot;&gt;&lt;/i&gt;
              &lt;/div&gt;
                                          
     &lt;!--- form buttons ---&gt;
    &lt;div id=&quot;dButtonsReviewForm&quot; class=&quot;row&quot;&gt;
        &lt;a onClick=&quot;checkForm()&quot; name=&quot;submit&quot; class=&quot;cta pull-right&quot;&gt;Submit&lt;/a&gt;
        &lt;a href=&quot;javascript:hideReviewMe()&quot; class=&quot;pull-right cta&quot; style=&quot;margin-right:6px&quot;&gt;Cancel&lt;/a&gt;
     &lt;/div&gt;
    &lt;!--- form saving ---&gt;
        &lt;div id=&quot;dSavingReviewForm&quot; style=&quot;display:none&quot;&gt;
            &lt;span class=&quot;pull-right hibuBtn&quot; style=&quot;cursor:wait&quot;&gt;&lt;i class=&quot;fa fa-spinner fa-spin&quot;&gt;&lt;/i&gt; Saving&lt;/span&gt;
        &lt;/div&gt;
  </code></pre>
  
  <p>Here is the JS code:</p>
  <pre><code>/* intercept submit event */
  $( &quot;#fReviewMe&quot; ).submit(function(event) {
    checkForm();
    event.preventDefault();
  });
  
  /* form validation */
  function checkForm(){
    var errors = 0;
    var cuname = $('#uname').val();
    var ccompany = $('#business').val()
    var creview = $('#reviewmsg').val()
    var cstars = $('#rStar').val()
    var eMessage = &quot;&quot;;
    $('#dFormErrors').hide();
    $('input').removeClass('validFalse');
    $('textarea').removeClass('validFalse');
  
    if ($('#tnc').is(':checked')) {
    }
    else{
      eMessage = &quot;Please tick to accepts out terms and conditions&quot;;
      errors++;   
    }
  
    if(cstars.length &lt; 1){
      $(&quot;input&quot;).blur();
      $(&quot;textarea&quot;).blur();
      eMessage = &quot;Please choose a star rating&quot;;
      errors++;
    }
  
    if(creview.length &lt; 1){
      $('#reviewmsg').focus();
      $('#reviewmsg').addClass('validFalse');
      eMessage = &quot;Please add your review&quot;;
      errors++;
    }
    else{
      $('#reviewmsg').addClass('validTrue');
    }
  
    if(ccompany.length &lt; 1){
      $('#business').focus();
      $('#business').addClass('validFalse');
      eMessage = &quot;Please tell us your business name&quot;;
      errors++;
    }
    else{
      $('#business').addClass('validTrue');
    }
  
    if(cuname.length &lt; 1){
      $('#uname').focus();
      $('#uname').addClass('validFalse');
      eMessage = &quot;Please tell us your name&quot;;
      errors++;
    }
    else{
      $('#uname').addClass('validTrue');
    }
  
    /* check errors and submit */
    if(errors &gt; 0){
      $('#dFormErrors').slideDown();
      $('#sEMessage').html(eMessage)
    }
    else{
      $('#dButtonsReviewForm').hide();
      $('#dSavingReviewForm').show();
      $('#fReviewMe').submit();
    }
  
  }
  </code></pre>
  <p>Thanks in advance</p>