javascript - Bootstrap Formwizard - Prevent to scroll to next step if each page form submitting ajax response gets error -


i using twitter bootstrap form wizard submit data on each page validation. want prevent, scroll next step if ajax response gets error while submitting data. below code,

'onnext': function(tab,navigation,index){     //scrollto('#wizard',-100);     if(index == 1){         var $valid = $('#register_form').valid();         if(!$valid){             $validator.focusinvalid();             return false;         }         else         {             var options = $('form[name=register_form]').find('input, textarea, select').filter('.fw1').serialize();             var data = options + '&step=1';             $.ajax({                 type: 'post',                 url: 'employeeentryprocess.php',                 data: data,                 success: function(data){                     this.show(2);                 },                 error: function(){                     return false;                 }             });         }     } }, 

thanks,

the way return false doesn't scroll next step automatically, , manually scrolling next step in success function of ajax request (so proceed if successful). may want put animation duration of ajax request otherwise nothing happening.


Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -