Client Script not showing variable message on new line

Prudhvi Potru
Tera Contributor

In a client script, I’m trying to display a message on a variable field with line breaks (using <br> or \n). But the message appears in a single line. Is there a ServiceNow-supported way to render messages with new lines or styled HTML in catalog items?

Instead on writing 3 new g_form.showMessage('cc', 'My message');
is there any way to insert a new line in long description?

5 REPLIES 5

J Siva
Tera Sage

Hi @Prudhvi Potru 
As Ankur mentioned, g_form.showFieldMsg() does not support HTML tags. As an alternative, consider using a 'Rich Text Label'.
Sample:

JSiva_0-1751945122785.png

JSiva_0-1751945264688.png

 

Regards,
Siva