How to have a multi line placeholder text?

veena_kvkk88
Mega Guru

Hi everyone!!

I need to have a placeholder text in a string field of length 1000, consisting of multiple lines. Something like this:

[Logo]

[Job Name]

[Task Name]

[Number Range]

[Delivery Date]

I followed this thread Support for HTML 5 placeholder attributeand the solution worked perfectly for a single line, but am unable to insert multiple lines. Could someone help me achieve this? Thanks a ton in advance!!

1 ACCEPTED SOLUTION

Nana5
Mega Guru

Hi Kotha,


Please try with \r\n. it should work.



Thanks


View solution in original post

7 REPLIES 7

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Hi Veena,



In your text, just use \n as a line break, so you would do something like:



u_addPlaceholderAttribute('short_description', 'Enter a short description of the problem\nSomething on the next line');


I tried that already but it didn't work Brad. It just skipped printing \n and printed the rest.


Any idea how it will work in the field type of HTML? It does not work with \r\n or any other HTML line-break html tag as well.

@Kamlesh Prasad did you find a way to do this? I am also looking for a solution for HTML type fields.