The Zurich release has arrived! Interested in new features and functionalities? Click here for more

How to print a text in new line in client script of portal page

Madhavi2
Tera Contributor

Hi All,

I am updating a error message in login page.

I would to print the text line by line. But it is coming as continuous text.

I am trying as below in client script of portal page.

c.message = "Your account is locked.Please contact help to reset your password.\nToll Free1: 1800, or send an SMS to 1111"+'\n'+'Toll Free2: 1888, or send an SMS to 2222';

 

Madhavi2_0-1713196224701.png

Please help me on this.

I would like to print as below.

Your account is locked.Please contact help to reset your password.

Toll Free1: 1800, or send an SMS to 1111

Toll Free2: 1888, or send an SMS to 2222

 

3 REPLIES 3

Amit Pandey
Kilo Sage

Hi @Madhavi2 

 

Can you try following-

 

c.message = "Your account is locked. Please contact help to reset your password.<br>Toll Free1: 1800, or send an SMS to 1111<br>Toll Free2: 1888, or send an SMS to 2222";

Please mark my answer helpful and correct.

Regards,

Amit

Hi @Amit Pandey ,

Thank you for your reply. I tried this already. But no luck.

Hi @Madhavi2 

 

Give this a try-

 

c.message = "<div>Your account is locked. Please contact help to reset your password.</div><div>Toll Free1: 1800, or send an SMS to 1111</div><div>Toll Free2: 1888, or send an SMS to 2222</div>";

 

Try this too-

 

-->in some cases, \r\n or just \r might work instead of \n

c.message = "Your account is locked. Please contact help to reset your password.\r\nToll Free1: 1800, or send an SMS to 1111\r\nToll Free2: 1888, or send an SMS to 2222";

 

Regards,

Amit