- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2022 11:20 AM
I have this field I want to set to mandatory and read only because this information autopopulates, but if information doesn't autopopulate I don't want users to be able to submit form
Here is example of field not auto populating, it's set to read only because I don't user selecting their own VP and a VP approval is mandatory. So is there a way to set both mandatory and read only? As soon as I set to mandatory it gets rid of readonly
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2022 11:27 AM
You could use UI policies, but it would be much more straight forwards to create an onSubmit client script to check if the field is empty, and if it is, prevent the submission of the form. Using a UI policy to achieve this, mandatory and read only are conflicting and it may cause unintended issues, especially if multiple fields are involved.
Here is a link to an example script you can use to check if the fields are empty on submit, and prevent the submission and show an error message.
If this resolved your issue, please mark this correct and helpful, thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2022 11:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2022 11:26 AM
Check the scripts you created, what did you create to auto populate fhe variable? BR? client script? check those, the issue may be there.
Regards

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2022 11:27 AM
You could use UI policies, but it would be much more straight forwards to create an onSubmit client script to check if the field is empty, and if it is, prevent the submission of the form. Using a UI policy to achieve this, mandatory and read only are conflicting and it may cause unintended issues, especially if multiple fields are involved.
Here is a link to an example script you can use to check if the fields are empty on submit, and prevent the submission and show an error message.
If this resolved your issue, please mark this correct and helpful, thanks!