- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
19 hours ago
I'm working on a catalog client script where I need to perform a server-side validation during the onSubmit event. The use case is to restrict form submission if the user already has a device listed in the Asset table.
I'm using getXML() to make a GlideAjax call inside the onSubmit client script. The callback function checks the response and conditionally allows or blocks the submission using return false. The validation logic works fine when the condition is met.
However, when the condition fails (i.e., the user should be allowed to submit), the form seems to be submitted multiple times, causing looping behavior. I added an alert() in the else block to debug, and it keeps triggering repeatedly
catalog client script:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
18 hours ago
check this link and enhance your script
How To: Async GlideAjax in an onSubmit script
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
18 hours ago
check this link and enhance your script
How To: Async GlideAjax in an onSubmit script
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
14 hours ago
The suggested link has the script which worked for me when i modified my script as per the script given in the link
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
13 hours ago
Glad to know.
Please share your final script so that it helps other members in future.
Also was this for catalog item or record producer?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader