我正在尝试实现jQuery 步骤插件,我从一些基本的 html 和表单开始,但我无法运行步骤。我也检查了控制台,但没有错误。
我在我的 HTML 中设置这个例子:http://www.jquery-steps.com/Examples#basic-form
我的脚本代码:
jQuery(function (){
function errorPlacement(error, element){
element.before(error);
}
jQuery("#submit-steps").steps({
headerTag: "h3",
bodyTag: "ul",
transitionEffect: "slide",
onStepChanging: function (event, currentIndex, newIndex){
jQuery("#form-2").validate().settings.ignore = ":disabled,:hidden";
return jQuery("#form-2").valid();
},
onFinishing: function (event, currentIndex){
jQuery("#form-2").validate().settings.ignore = ":disabled";
return jQuery("#form-2").valid();
},
onFinished: function (event, currentIndex){
alert("Submitted!");
},
labels: {
cancel: "Cancel",
finish: "Finish",
next: "Continue",
previous: "Previous"
}
});
});
我的 JSFiddle:http: //jsfiddle.net/6Zd5u/26/
需要你的帮助。
谢谢。