我没有看到这个问题 – 尽管我确实阅读过100个关于类似主题的jQuery步骤 – 似乎没有解决我的问题.
我正在使用jQuery步骤,并希望在第一步完成后添加“重置”按钮 – 以防我的用户想要清除表单并重新开始.我希望在默认的“下一步”按钮后按下此按钮.
这是我当前基于默认基本表单here的脚本
$(function ()
{
function errorPlacement(error, element)
{
element.before(error);
}
$("#form").validate({
rules: {
zip: {
required: true,
maxlength:5,
minlength:5
},
phone: {
required: true,
minlength: 10,
phoneUS: true
}
}
});
$("#wizard").steps({
headerTag: "h3",
bodyTag: "section",
transitionEffect: "slideLeft",
onStepChanging: function (event, currentIndex, newIndex)
{
// Allways allow step back to the previous step even if the current step is not valid!
if (currentIndex > newIndex)
{
return false;
}
$("#form").validate().settings.ignore = ":disabled,:hidden";
return $("#form").valid();
},
onFinishing: function (event, currentIndex)
{
$("#form").validate().settings.ignore = ":disabled";
return $("#form").valid();
},
onFinished: function (event, currentIndex)
{
alert("Thank you! Your request has been sumbitted.");
}
});
});