onSubmit Catalog Client script not working on resubmitting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2020 07:45 AM
Hi All,
I have a onSubmit catalog client script which is checking if a question (Question 1) on the record producer is answered or not. This is checked via onSubmit catalog client script because the choices of the Question 1 are filtered based on another question (Question 2) on the record producer.
When I click submit and does not have a valid response in the Question 1 then it gives the error. After the error I select a response to the Question 1 which via a Catalog Client UI Policy makes one other question (Question 3) visible and mandatory. Now when I answer this Question 3 as well and try pressing Submit... nothing happens (checked via putting alerts in the Catalog client script that it even does not checks the onSubmit client script in this case).
If after the error I would select a response to Question 1 which does not calls any other Catalog UI Policy then it works fine and when I re submit the form it gets submitted.
Below is my onSubmit Catalog client script
function onSubmit() {
var training = g_form.getValue('u_nature_of_this_request');
if (training != 'waitlist' && training != 'cancel' && training != 'change_the_date') {
g_form.addErrorMessage('Please select one response for "What is the nature of this request?"');
return false;
}
}
The UI Type is set to All.
The Isolate Script is not checked.
Please suggest how I could make it work that the Submit button works the second time as well in case of another Catalog UI policy ran between the first submit and second submit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2020 07:51 AM
Can you share the Catalog UI Policy? Is there code in it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2020 08:51 AM
Hi Willen,
It is a normal Catalog UI Policy which based on responses in Question 1 above set the display and mandatory of Question 3.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2020 07:57 AM
Pull up your Dev Tools (i.e. Chrome, Firefox, etc.) and see what error messages you get when trying to reproduce this behavior, more than likely it'll give you a clue on what the issue is.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2020 08:53 AM
Hi Ashley,
I have checked and there are no error messages. Though everything is working fine when I click on "Try It" on the record producer but the same is not working on the portal.