Stop the Form Submission onsubmit catalog client script AJAX

G Bhargavi
Tera Contributor

Hi 

I am trying to stop form submission in onsubmit client script . I am using GlideAjax .

If I can't use getXMLWait() as it doesn't work in Portal.

I cant use g_scratchpad as it doesn't work in Native UI.

If I take a variable and make it true/false based on answer from ajax as suggested in many places even it doesn't work .

 

Need help !!!

4 REPLIES 4

Maik Skoddow
Tera Patron
Tera Patron

This question is so often asked (did you you leverage the search function first before asking?) that ServiceNow has provided the answer with an example script: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0779964 

Based on that approach, you will find a more extensive version in the following article: https://www.servicenow.com/community/developer-blog/how-to-async-glideajax-in-an-onsubmit-script/ba-... 

Hi Maik, Thanks for the response 

The problem which I already mentioned was g_scratchpad will not work for Native desktop , it works only for mobile/service portal . If I use getXMLWait() it will work on native , but getXMLWait() won’t work on portal. Everyone in forum gave solutions for portal(using g scratchpad) and native UI (using getXMLWait()). But I am not supposed to use getXmLWait() .. Hope you understood my problem!!!

 

pls help

Hi Maik, 

Thanks for the reply 

But the problem was g_scratchpad won’t work for native desktop , getXmLwait won’t work in portal and also as per guide lines getxmlwait should not be used . That’s the issue.

 

please suggest any other possible solution..

Guillaume VERME
Tera Contributor

Same problem, on my side. 

Can't use the scratchpad or the XMLWait. 

 

So can we have an update on this, before opening a ServiceNow case.