【发布时间】:2016-07-17 16:35:52
【问题描述】:
如何验证 Fuelux 向导的每个步骤(单击下一步按钮时)?
函数的jquery代码是这样的。
$('#myWizard').on('actionclicked.fu.wizard', function (evt, data) {
// validation code for the step here.
// jquery validator, AFAIK validates only the whole form.
// in this case, only the ancestor div
// had tried this
var curstep = $('#myWizard').wizard('selectedItem');
var curstepcontainer = $(this).closest(".step-pane");
curstepcontainer.validate();
// and this
if (curstep.step === 1)
{
$('#field1').validate();
$('#field2').validate();
}
});
两者都没有工作。
虽然这种方法可能是使其发挥作用的一种方法,但还有其他理想的方法吗?
我从https://collegeparktutors.com/get-tutor?course_dropdown=19 了解到这是可以做到的。
还检查了 formvalidation.io (http://formvalidation.io/examples/fuel-ux-wizard/),他们有一个很好的工作代码,这解决了我们的问题。然而,这是一个商业产品,我们正在探索开源/免费工具:-)
任何指针,帮助,建议表示赞赏! 谢谢!
【问题讨论】:
标签: jquery jquery-validate wizard fuelux