jquery フォーム ウィザードを使用して、2 つのステップでフォームを表示します。2 番目のステップに進む前に、jquery フォーム プラグインを使用して、ステップ 1 でフォーム フィールドの ajax 検証を行います。
私が抱えている問題は、完全なフォームも ajax を使用して投稿されていることです。結果を表示する別のページにリダイレクトする代わりに、結果は同じページで取得されます。ajaxを使用せずに完全なフォームを投稿するようにフォームプラグインを構成するにはどうすればよいですか?
<script type="text/javascript">
$(function(){
$("#Catering").formwizard({
formPluginEnabled: true,
validationEnabled: true,
focusFirstInput : true,
remoteAjax : {"first" : { // add a remote ajax call when moving next from the second step
url : "/validate",
dataType : 'json',
beforeSend : function(){alert("Starting validation.")},
complete : function(){alert("Validation complete.")},
success : function(data){
if(!(data.geldig)){ // change this value to false in validate.html to simulate successful validation
$("#status").fadeTo(500,1,function(){
$(this).html(data.errormessage)
});
return false; //return false to stop the wizard from going forward to the next step (this will always happen)
}
return true; //return true to make the wizard move to the next step
}
}},
}
);
});
</script>