I am having a bit of an issue with getting a form not to auto submit on iOS devices (which I have solved using the following).
key = window.event.keyCode; //IE
key = e.which; //firefox
return (key != 13);
However I also need it to then hide the on-screen keyboard which is where I am a bit stuck.
The elements of the HTML of the form are as follows:
<form role="form" method="POST" name="level1buttons" id="level1buttons">
<input id="notes" name="notes" type="text" class="form-control" onKeyPress="return disableEnterKey(event)" placeholder="Other comments">
<button type="button" class="btn btn-black" value="Exit" onClick="autoSubmit();">Save & Finish</button>
The input field NOTES being what causes the form to submit, presumably by running autoSubmit() which is as follows:
var formObject = document.forms['level1buttons'];