I have an input element with onchange="do_something()". When I am typing and hit the enter key it executes correctly (do_something first, submit then) on Firefox and Chromium (not tested in IE and Safari), however in Opera it doesn't (it submits immediately). I tried using a delay like this:
<form action="." method="POST" onsubmit="wait_using_a_big_loop()">
<input type="text" onchange="do_something()">
</form>
but it didn't work either.
Do you have some recommendations?
Edit: Finally I used a mix of the solutions provided by iftrue and crescentfresh, just unfocus the field to fire do_something() method, I did this because some other input fields had others methods onchange.
$('#myForm').submit( function(){
$('#id_submit').focus();
} );
Thanks