Reputation: 1635
I have an issue with the button clicking with Ctrl key. The form is being posted twice. (on the same tab and on the new tab)
I don't want to go to new tab (in order to avoid twice submission)
I tried return false;
onClick="document.form[0].submit(); return false;"
but no success.
Thanks for any help.
Here is jsFiddle
Upvotes: 2
Views: 363
Reputation: 651
try next:
document.form[0]
by
document.forms[0]
;name
attribute for your input tag;type
attribute to button
Upvotes: 1
Reputation: 85573
Try this:
$('#submit').on('click',function(e){
e.preventDefault();
document.form[0].submit();
});
Upvotes: 0