0
jquery 양식 마법사를 사용하여 두 단계로 양식을 표시합니다. 두 번째 단계로 진행하기 전에 jquery 양식 플러그인을 사용하여 1 단계에서 양식 필드의 Ajax 유효성 검사를 수행합니다.첫 번째 단계 후 jquery formwizard stop form plugin (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>