Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

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?

7 REPLIES 7

Its_Azar
Kilo Sage

Hi there @deepakmaury 

But why? you do wither one, why both?  

☑️ If this helped, please mark it as Helpful or Accept Solution so others can find the answer too.

Kind Regards,
Azar
Serivenow Rising Star
Developer @ KPMG.

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