onSubmit Client Script finishing before GlideAjax return value is processed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 07:04 AM
I have a client script which will ultimately decide whether it will return false and display an error message to the user if certain criteria is not met.
It initially just had a client-side check which worked perfectly, but now we need to check a condition server side for an additional check.
The issue I'm running into is that despite the GlideAjax returning the correct value (T/F) and display the error, the client script still finishes and saves the record - feels like the client script is finishing before displaying all the alerts.
Is there a way I can ensure the Client Script waits for all the server side conditions to return before running the last check to see whether it should process the onSubmit?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 08:49 AM
You can have the CS wait for the server using 'ga.getAnswer()' if using 'ga.getXMLWait()' to sned the request to the server. See:
Search examples as DrewW mentions.