Color for alert message

Devika3
Tera Guru

Hi All,

Is there a way to show the alert message in red color using catalog client scripts.

Thanks in advance.

Regards,

Devika.

4 REPLIES 4

Community Alums
Not applicable

Hi @Devika ,

g_form.addErrorMessage('Your Error message will go here');

This should be enough.

Mark my answer correct & Helpful, if Applicable.

Thanks,

Sandeep

Hi Sandeep,

The alert should show the ok and cancel button. If we are using addErrorMessage we wont get that .

Thanks,

Devika.

Community Alums
Not applicable

Hi Devika,

Your original question was different.

Here you need a confirm box not alert. Create a on submit client script with your company condition and add the below sample script :

You may use the following onSubmit client script:

function onSubmit() {
    //Type appropriate comment here, and begin script below
      var myCompany = g_form.getValue('u_company');
     confirm("Your company is" + myCompany ", do you want to continue?");

}

Mark my answer correct & Helpful, if Applicable.

Thanks,

Sandeep

Tony Chatfield1
Kilo Patron

This post on ServiceNow Guru covers off the formats and colors of generic messages

https://servicenowguru.com/scripting/ui-info-error-message-cheat-sheet/