How to Set Field Mandatory on UI Page

AlwinJebakY
Tera Expert

Hi,

I need to make a few fields mandatory on a UI Page.

I already tried:

  1. Adding the required attribute in HTML
  2. Using gel() and setting required = true
  3. 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

Tanushree Maiti
Tera Patron

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