title: Multi-Page form using AJAX, Jquery and PHP
body: <p>I am currently trying to create a multi-page form that uses both jQuery and PHP together to error check.  The issue I have is that I am relatively new to jQuery, and don't know how to move to the second form rather than just display a success message from a PHP array.</p>
  
  <p>I have used the example from ( <a href="http://www.youtube.com/watch?v=BwExOhVaUyk" rel="nofollow">http://www.youtube.com/watch?v=BwExOhVaUyk</a> ) as my guide. Its an example that uses the <code>ajax_submit</code> to process when form is ready, if it is successful the PHP script runs and error checks and then throws back a successful message.</p>
  
  <p>I do not want the success message.  I want if successful to move to second page, but not sure how to do this.</p>
  
  <pre><code>The following is the ajax code
  
  // make our ajax request to the server
  function submitForm(formData) {
      $.ajax({    
          type: 'POST',
          url: 'feedback.php?images=' + encs.toString(),      
          data: formData,
          dataType: 'json',
          cache: false,
          timeout: 7000,
          success: function(data) {           
  
              if(data.error == true){
  
              $('form #response').removeClass().addClass('error').html(data.msg).fadeIn('fast');                                      
  
              } else{
                  $("#rightcolumn").fadeOut(500, function(){
  
                      //NOTE THIS IS THE LINE THAT BRINGS BACK THE SUCCESSFUL MESSAGE STORED IN data.msg (taken from array in php file).
  
                      $("#rightcolumn").append().html(data.msg).fadeIn(500);
                  });
  
              }
  
  
  
          },
          error: function(XMLHttpRequest, textStatus, errorThrown) {
  
              $('form #response').removeClass().addClass('error')
                          .html('&lt;p&gt;There was an&lt;strong&gt; ' + errorThrown +
                                '&lt;/strong&gt; error due to a&lt;strong&gt; ' + textStatus +
                                '&lt;/strong&gt; condition.&lt;/p&gt;').fadeIn('fast');           
          }
  </code></pre>
  
  <p>THE PHP</p>
  
  <pre><code>$return['error'] = false;
              $return['msg'] = "&lt;html&gt;";
              $return['msg'] .="&lt;head&gt;"; 
              $return['msg'] .="&lt;/head&gt;"; 
              $return['msg'] .= "&lt;div id=\"coverrightb\"&gt;";
              $return['msg'] .= "&lt;body&gt;";
              $return['msg'] .= "&lt;h2&gt;Successful Registration &lt;img id=\"thumbsup\" src=\"images/icons/thumbsup.png\" alt=\"ThumbsUp\" /&gt;&lt;/h2&gt;";
              $return['msg'] .= "&lt;br /&gt;"; 
              $return['msg'] .= "&lt;p&gt;Thanks for registering " .$firstname .". Your details are below.&lt;/p&gt;";
              $return['msg'] .= "&lt;br /&gt;"; 
  echo json_encode($return);
  </code></pre>
  
  <p>I want it to simply move on to second page, not sure how to do this.  Would be really grateful for some guidance.  I'm learning PHP and jQuery but been stuck on this for several weeks.</p>
  
  <p>Many thanks</p>