Line breaks in showFieldMsg()?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2015 12:29 PM
Hello,
Does anyone know of a way to insert line breaks in a field message within the showFieldMsg() method?
Tongue Twister not intended.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2017 10:39 AM
... not really.
I need the line break due to "optical" reasons .. and adding many lines looks kind of "uncool" for me, due to the visible line due to color change ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2017 10:47 AM
Yes I agree it doesn't look as cool as it would if it were one block of text. Alas, I don't know the solution to that

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2018 05:09 AM
Try to use simillar code:
var message_text = g_form.getValue('field_1') + '\n' + g_form.getValue('field_2'); //just a sample of message with line breaks
var controlID = g_form.getControl('field_name').id + '_fieldmsg'; //It will give you id of div containing error, warning, info message
g_form.showFieldMsg('field_name', message_text, 'error'); // here comes the code that shows message
document.getElementById(controlID).style.whiteSpace = 'pre-wrap'; //magic happens here
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2018 04:09 AM
I tried with \n but it didn't worked for me. So I wrote 2 g_form.showFieldMessage() for both lines and it worked as expected.
I don't know whether it is currect way to do it but it did worked for me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2020 06:07 AM
Hello,
you can use "<br\>" to make it in next line.
Ex message: "First line.Second line"
you should enter the string as "First line.<br\> <br\>second line"
output:
First line
Second Line
Note:Please accept the sution if it works for you.