- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2024 08:17 PM
I have a n onload client script where I am checking the state and setting a field mandatory but it is not working. There are no UI policies on this field. I dont even get the alert in the beginning of the script I added.
Solved! Go to Solution.
- Labels:
-
Request Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2024 08:22 PM
Check the console in your browser's developer tools. I'm guessing there's an error somewhere else that's stopping this script from running.
Once you figure that out, it's probably a good idea to switch over to a UI Policy to set it mandatory.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2024 08:42 PM
@samadam If you need to make field mandatory on the state change, then you need to create an onChange script on the State field. onLoad script only gets called when the form loads whereas the onChange script gets called whenever there is a change in the value of a specific field.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2024 08:44 PM
Figured it out, There was a premature closure of a ")" which caused it. Once I fixed that it started working. Thank you. I am surprised how the script saved successfully.