A
Andrew Poulos
I have a form that looks something like the following:
<form">
<div id="pg0">
<!-- more HTML here -->
<input type="text" name="f0_0" >
</div>
<div id="pg1" style="display:none;">
<!-- more HTML here -->
</div>
<div id="pg2" style="display:none;">
<!-- more HTML here -->
<input type="submit" name="finish" value="Finish">
</div>
</form>
The form has 3 pages. You fill in details on each page and click a
'continue' button to go to (reveal) the next page. It all works fine
except that when focus is in the text input "f0_0" and the user presses
the Enter key I want to update the information on the current page.
Currently its causing the form to be submitted.
How can I override this behaviour so that the Enter key does not submit
the form when the text input has focus but instead runs one of my functions?
Andrew Poulos
<form">
<div id="pg0">
<!-- more HTML here -->
<input type="text" name="f0_0" >
</div>
<div id="pg1" style="display:none;">
<!-- more HTML here -->
</div>
<div id="pg2" style="display:none;">
<!-- more HTML here -->
<input type="submit" name="finish" value="Finish">
</div>
</form>
The form has 3 pages. You fill in details on each page and click a
'continue' button to go to (reveal) the next page. It all works fine
except that when focus is in the text input "f0_0" and the user presses
the Enter key I want to update the information on the current page.
Currently its causing the form to be submitted.
How can I override this behaviour so that the Enter key does not submit
the form when the text input has focus but instead runs one of my functions?
Andrew Poulos