Following problem:
On my site, I have two forms. One for login and one for main data.
I have only one submit button in the mainform.
The loginform is submitted via js on mainform submit.
This works fine. But in Safari I can press Enter while my focus is inside the login form. This will send the login form without the mainform, so I get an error (It redirects me to a plain view of a json I request on submit).
Is it possible to disable the “on enter pressed” action?
If you say you use anyway the JS to submit the data in the form why not cancel the default behaviour of the browser with
<form onsubmit="return false;">. This way no matter if you press the submit button or press enter in an input it won’t be sent. The onsubmit=”return false” shouldn’t interfere with calling the submit() method on the form from JS.