We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

How to apply flash for mandatory fields?

bharu
Kilo Expert

Hi,

function onSubmit() {  

  var fieldCheck = g_form.getValue('u_yes');  

  if (fieldCheck=='false') {  

          g_form.setMandatory('u_yes', true);

    alert('The top five fields in this form are mandatory');

    g_form.getControl('yes').focus();

          return false;  

  }  

}  

Iam getting an alert and field is also to madatory on running this code. But I want flash at the time when alert appears. "g_form.flash" is not working. Is there any alternate for this?

6 REPLIES 6

I used g_form.flash('label_IO:33586fd4ad054100872edb6647c09400',"#CC0000", -2); it is working.. Thank you..


Pradeep Sharma
ServiceNow Employee

Cool.


Please mark the response as correct/helpful if this is now resolved