
Dave S. answered 04/10/19
Experienced computer professional ready to help!
I had the same issue on my pages. I did not want the return key to enter the form. After some research I found the following javascript code to disable it.
<script type="text/javascript">
// --- With this function the tab key must be used between fields
// --- onkeypress='stopEnterSubmitting(window.event)' added to the form element
function stopEnterSubmitting(e) {
if (e.keyCode == 13) {
var src = e.srcElement || e.target;
if (src.tagName.toLowerCase() != "textarea") {
if (e.preventDefault) {
e.preventDefault();
} else {
e.returnValue = false;
}
}
}
}
</script>
The way it is used is to add onkeypress='stopEnterSubmitting(window.event)' to the form statement.