stop submit request though "enter" from my form on Service Portal

omsa1
Kilo Guru

I found a workaround  but not sure how to apply it, where should i add this script.Please guide me. 

$j("form").bind("keypress", function (e) {
   
if (e.keyCode == 13) {
            e.preventDefault()
;
   
}
});

https://community.servicenow.com/community?id=community_question&sys_id=0a1f3e29db58dbc01dcaf3231f961901

If there is any other way to achieve this please let me know. Thanks. 

1 ACCEPTED SOLUTION

omsa1
Kilo Guru

Hi All,

Thanks for all the suggestions.

 

I achieved this by following PRB1189578,

1. This problem can be resolved by placing the input fields outside the form tag, this will prevent the form from being submitted on pressing enter.

View solution in original post

6 REPLIES 6

Its already there. 

omsa1
Kilo Guru

Hi All,

Thanks for all the suggestions.

 

I achieved this by following PRB1189578,

1. This problem can be resolved by placing the input fields outside the form tag, this will prevent the form from being submitted on pressing enter.