如何解决Parsley 在 Firefox 中没有正确跳转到错误
navigate(n,showEvenIfInvalid = false) {
this.parsley.whenValidate({
group: "block-" + this.currentTab
}).done(() => {
this.tabValidationState[this.currentTab].state = "valid";
this.currentTab = parseInt(n);
this.prevIoUsTab = this.currentTab-1;
// Otherwise,display the correct tab:
this.showTab(this.currentTab);
}).fail(() => {
// $("#validated-" + this.currentTab).val("False");
this.tabValidationState[this.currentTab].state = "invalid";
if (showEvenIfInvalid){
this.currentTab = parseInt(n);
this.prevIoUsTab = this.currentTab-1;
// Otherwise,display the correct tab:
this.showTab(this.currentTab);
}
}
在每个选项卡中都有多个必填字段。如果我有一些遗漏,我会尝试导航到下一个选项卡,欧芹开始并正确跳转到第一个错误。但是如果我填写并尝试再次按 Next 按钮保持活动状态并且表单不会跳转到下一个错误。我需要再次单击该按钮才能使其正常工作。调试js时我看不到任何奇怪的东西。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。