How to return the response from jQuery AJAX? <p>I am working with <code>bootstrapWizard</code> and need to submit a form each step.Submitting forms using ajax and validating the form in server.I need to pass the return value to <code>onNext</code> .But it is always return true.</p> <pre><code> $('#buyer_wizard').bootstrapWizard({ 'tabClass': 'form-wizard', onTabClick: function(tab, navigation, index) { return false; }, onNext: function(tab, navigation, index){ var url=$("#buyer_form_step"+index).attr('action'); var data=$("#buyer_form_step"+index).serialize(); $.ajax({ type: 'POST', url:url, data:data, async:false, success:function(data){ return data }, error: function(data) { // if error occured alert(JSON.stringify(data)); }, dataType:'json' }); } }); </code></pre> <p>onNext is true always and going to next screen even if the ajax return value is false. </p>