Skip to content

Commit

Permalink
fixed: possible form submission if button element clicked and js even…
Browse files Browse the repository at this point in the history
…t not stopping event
  • Loading branch information
pollen8 committed Dec 30, 2013
1 parent 6670194 commit d02a170
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions media/com_fabrik/js/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -1144,8 +1144,14 @@ var FbForm = new Class({
Fabrik.fireEvent('fabrik.form.ajax.submit.end', [this]);
} else {
// Inject submit button name/value.
new Element('input', {type: 'hidden', name: btn.name, value: btn.value}).inject(this.form);
this.form.submit();
if (typeOf(btn) !== 'null') {
new Element('input', {type: 'hidden', name: btn.name, value: btn.value}).inject(this.form);
this.form.submit();
} else {
// Regular button pressed which seems to be triggering form.submit() method.
e.stop();
}

}
}
}.bind(this));
Expand Down

0 comments on commit d02a170

Please sign in to comment.