Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

How to split field message in two lines in client script

Jagen Chinnapul
Tera Contributor

Hi All, 

I need to split the field message into two lines.

 

 textMsg = msg.replace(/\{0\}/g, "Mobile Phone: "+result.mobile_phone1).replace(/\{1\}/g, "Business Phone: "+result.phone);

2 REPLIES 2

BalaG
Kilo Sage

Hi @Jagen Chinnapul   I am assuming you want to textMsg to be split in to two lines, adding "\n" as shown below should do the trick

 textMsg = msg.replace(/\{0\}/g, "Mobile Phone: "+result.mobile_phone1 + "\n").replace(/\{1\}/g, "Business Phone: "+result.phone);

 

hope that helped

--

Bala Guthy

Please mark this as a solution or click helpful as appropriate

Maik Skoddow
Tera Patron

Hi @Jagen Chinnapul 

it is not clear what your code example should represent.

The only thing I know, is that field messages don't allow HTML, and thus you cannot force a line break within them.

Maik