- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2022 05:40 AM
Hello Experts,
We have an onsubmit Catalog Client script that performs some validation and because of this, we have to click the submit button twice to submit the request.
OnSubmit client script contains g_scratchpad variable to stop the form from submitting until validation done
Any suggestion to avoid that twice clicking.
Thanks,
Shahebaz
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2022 06:14 AM
Thank for your reply experts but somehow I got it here,
https://community.servicenow.com/community?id=community_article&sys_id=e37f2072db9fd0103daa1ea6689619c6
Not sure if it's dependent on the version but on Rome, if the answer function returns true I need to click again on submit button because the actionName variable return "none". I fix it by putting 'submit' in g_form.submit() function.
g_scratchpad.isFormValid = true;
g_form.submit('submit');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2022 05:48 AM
Share your script, and are you setting return as false in the validation that might be obstructing submission. If your form validation is validation return true, then twice clicking won't be required.
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2022 05:49 AM
For which reasons you are using g_scratchpad on onSubmit script?
What validations you are checking?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2022 06:00 AM
Hi,
you are stopping the form submission since validation failed.
So unless user passes the validation the submit button won't allow you to submit the form.
That's how the platform behaves.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2022 06:14 AM
Thank for your reply experts but somehow I got it here,
https://community.servicenow.com/community?id=community_article&sys_id=e37f2072db9fd0103daa1ea6689619c6
Not sure if it's dependent on the version but on Rome, if the answer function returns true I need to click again on submit button because the actionName variable return "none". I fix it by putting 'submit' in g_form.submit() function.
g_scratchpad.isFormValid = true;
g_form.submit('submit');