Join us Dec. 16 for The Community Hour, our first global virtual User Group event!

How to break line in setValue

Abhijit Das7
Tera Expert

Hi Everyone

 

I want to know basic thing. How to break line in setValue .

 

g_form.setValue('comments', exp_id
+',' + model_name
+ ','+ desc );

 

I want break and display like : exp_id

                                                    model_name

                                                    desc 

 
Thanks in advance 
 
1 ACCEPTED SOLUTION

Ahmmed Ali
Giga Sage

Hello,

 

Try below code

g_form.setValue('comments', exp_id + '\n' + model_name + '\n'+ desc );

 

\n will add new line in string.

View solution in original post

3 REPLIES 3

Ahmmed Ali
Giga Sage

Hello,

 

Try below code

g_form.setValue('comments', exp_id + '\n' + model_name + '\n'+ desc );

 

\n will add new line in string.

Hello Ahmmed,

 

Could you please guide on how to add a newline within a text? Specifically for a field message? Apparently when I am using \n system is still not recognizing the newline within the message.

 

g_form.showFieldMsg('request_type','\\!/ This request only allows you to print.\n\\!/ This will install xx in the phone too','info');
 
This is a script running within an UI policy.

Ankur Bawiskar
Tera Patron

@Abhijit Das7 

Point mentioned by Ahmmed should work fine.

Please try that and share the updates.