I have created an onSubmit cat. Client Script to show an alert if a field is not filled by the user

deepakmaury
Tera Contributor

I have created an onSubmit  catalog Client Script to show an alert if a field is not filled by the user. However, when I make that field mandatory from the Variable settings, the alert does not appear. I also tried using a  catalog Client Script and a  catalog UI Policy, but the alert is still not working. What could be the reason, and how can I fix this?

6 REPLIES 6

To show an popup alert box on form submit is the requirement. However, I am not able to make the field mandatory on form load. Because of this, the alert is not triggering as expected when the form loads.

 

Ankur Bawiskar
Tera Patron

@deepakmaury 

Share your variable config screenshot.

If you are anyhow checking using onSubmit then don't make it mandatory at variable config

OR

Don't use script and make variable mandatory using variable config

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader