- 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 06:31 AM
Hi,
that is mostly used when we use synchronous GlideAjax
I am not sure if that would help you because if the validation fails the script would stop the form submission
Then user needs to populate the correct value and submit it again so that pass the validation passes and now the form would submit.
Anyhow if user is changing some value he/she has to submit the form inevitably.
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
‎03-10-2025 01:31 PM
I have same issue of users have to click twice on submit Button to submit the request when a UI catalog Policy "Show introductory period question if hire date is less than or equal to one year from today's date" is marked Yes. I traced this to an OnSubmit catalog client script validation. Kindly help on resolution.