ENXF NET
Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
- Joined
- Nov 13, 2018
- Messages
- 29,993
- Points
- 823
Reputation:
I'm trying to create a plugin. I want to use js to cancel a form submit by following code:
JavaScript:
Expected: When I click the submit button, it won't submit and console logs
Actually: Console shows
XenForo...
Read more
Continue reading...
JavaScript:
Code:
XF.on(form, 'ajax-submit:before', XF.proxy(this, 'beforeSubmit'));
// ...
function beforeSubmit(e) {
console.log('beforeSubmit:', this.submitting);
e.preventDefault();
this.submitting = true;
}
Expected: When I click the submit button, it won't submit and console logs
beforeSubmit: false.Actually: Console shows
beforeSubmit: false, but then it was submitted.XenForo...
Read more
Continue reading...