how to check mandatory field using script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2023 03:55 AM
How can i check if the field is mandatory in client script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2023 03:56 AM
Hi,
Use following code to get the list of Mandatory fields which are not filled by a user on the form in a client script.
var arr = g_form.getMissingFields();
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2023 04:33 AM
Thanks
But I am not looking for checking all the fields.
I have a variable name on the catalog form and I want to check for that specific field only .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2023 06:10 AM
You might be better served by using a UI Policy. If any mandatory fields are left blank, the system will pop-up a message letting the user know which fields need to be populated.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2023 06:13 AM
Hi @Akki1 ,
In clientscript we have g_form.isMandatory('field_name'); it returns true if field is mandatory and false if field is non mandatory.
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.