How to Set Field Mandatory on UI Page
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2026 07:37 AM
Hi,
I need to make a few fields mandatory on a UI Page.
I already tried:
- Adding the required attribute in HTML
- Using gel() and setting required = true
- Trying CSS-based approaches
None of these worked in my case.
Is there any OOB functionality in ServiceNow to make UI Page fields mandatory, similar to form mandatory behavior?
If not, what is the best practice to enforce mandatory validation on UI Pages?
Thanks
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2026 08:29 AM - edited 05-18-2026 08:30 AM
Hi @AlwinJebakY
You can use the input field to display with star using CSS.
Refer this post for the code: How to make UI Page field mandatory
creating a mandatory field in ui page?
Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti