title: JQuery SmartWizard Form Submission
body: <p>So I have a Spring Boot API project using <a href="https://github.com/mstratman/jQuery-Smart-Wizard/" rel="nofollow noreferrer">Jquery SmartWizard</a>. The first Step of 4 contains a simple form. For the sake of testing, am using with one field (ID: first-name).</p>
  <p>On clicking of the <code>Next</code> button of the Wizard, the jquery method should execute, form details posted to the database and then go to the <code>Next Step</code> of the Wizard(i.e. 2).</p>
  <pre><code>$( document ).ready(function() {
  $('#wizard').smartWizard({
      onLeaveStep: function() {
                   ajaxPost();
      }
  });
  
  $('.buttonNext').addClass('btn btn-success');
  $('.buttonPrevious').addClass('btn btn-primary');
  $('.buttonFinish').addClass('btn btn-default');
  
  function ajaxPost(){
  
      var formData = {
          name : $(&quot;#first-name&quot;).val()
          //lastname :  $(&quot;#lastname&quot;).val()
      };
  
      // DO POST
      $.ajax({
          type : &quot;POST&quot;,
          contentType : &quot;application/json&quot;,
          url : &quot;http://localhost:8080/api/uc/create&quot;,
          data : JSON.stringify(formData),
          dataType : 'json',
          success : function(result) {
              console.log(result)
          },
          error : function(e) {
              alert(&quot;Error!&quot;);
              console.log(&quot;ERROR: &quot;, e)
          }
      });
  
      //$('#wizard').smartWizard('goForward');
  
      // Reset FormData after Posting
      //resetData();
  
  }
  
  function resetData(){
      $(&quot;#first-name&quot;).val(&quot;&quot;);
      //$(&quot;#lastname&quot;).val(&quot;&quot;);
  }
  });
  </code></pre>
  <p>The <code>ajaxPost()</code> works but the Wizard doesnt move to the next step. If I uncomment this line <code>//$('#wizard').smartWizard('goForward');</code> The ajaxPost() function replicates alot of data in the database then.</p>
  <p>How do I get the Wizard to move to Step 2 after doing the form submit via the ajax functionality by clicking on the next button.</p>