- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2019 12:05 AM
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.
Solved! Go to Solution.
- Labels:
-
Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2019 03:23 PM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2019 12:57 AM
Hello,
Add that script in Link function script in the widget.
function(scope,elem)
{
$j("form").bind("keypress", function (e) {
if (e.keyCode == 13) {
e.preventDefault();
}
});
}
Try once
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2019 06:53 PM
Hi Bhagya Lakshmi,
Thanks for the reply. Are you saying add this in submit button widget , Link function option?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2019 08:16 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2019 01:01 AM
Hello,
Did you write that code or is that code exist already in link function option?