Hi all, as you know, enter key will submit the form automatically. is

Hi all,
as you know, enter key will submit the form automatically.
is there a way to remove this function?
i tried to remove and override all inputs's event by JS, but it does not work.
is this function implemented by JS?

Any favour will be appreciated,
thanks very much.

...

OriginalPostID-88407

OriginalPostID-88407

  Discussion posts and replies are publicly visible

Parents
  • The best option would be to enable your form as a Tempo Form and move your implementation to Tempo so the end-users can open the task there. This is disabled by default in there.

    If you still need to use JavaScript, here's the function

    function disableEnter() {
    var form = document.getElementsByTagName("form")[0];
    form.onkeypress = function () {
    var e = event;
    var code = (e.keyCode) ? e.keyCode : e.which;
    if (e.srcElement.type != "textarea" && (code == 13 || code == 3) ){
    return false;
    } else {
    formListener(event)
    }
    }
    }
Reply
  • The best option would be to enable your form as a Tempo Form and move your implementation to Tempo so the end-users can open the task there. This is disabled by default in there.

    If you still need to use JavaScript, here's the function

    function disableEnter() {
    var form = document.getElementsByTagName("form")[0];
    form.onkeypress = function () {
    var e = event;
    var code = (e.keyCode) ? e.keyCode : e.which;
    if (e.srcElement.type != "textarea" && (code == 13 || code == 3) ){
    return false;
    } else {
    formListener(event)
    }
    }
    }
Children
No Data