Hello,
I am trying to replace information in a text variable, which is then used in a HTML section. The issue I am facing is the replacement of new lines to <br> or </br>.
What I am currently doing, is making the user type in their text through a TextArea widget and I want the text displayed in the email to be the same format as they type it in. Meaning I would like tabs and new lines to show up.
I have confirmed the new lines are being saved to the text variable. But when I try to use the Replace() function, it doesnt seem to do anything.
My current code is:
Replace(TextVariable, NewLine(), "</br>")
Which is then fed into my HTML code looking like the attached image.
The email is being sent fine and everything but the TextVariable is behaving as wanted.
Any help would be greatly appreciated.
Hi @mbh,
you can try this Replace(Replace(TextVariable, Char(13) + Char(10), ""), Char(10), "").
Thanks,
Sriyamini J
Hi @Sriyamini,
This did the trick, thank you very much :)
Best regards,
Mbh
try to change </br> tag to be <br/>
EX: Replace(TextVariable, NewLine(), "<br/>") instead of Replace(TextVariable, NewLine(), "</br>")
Hi @Mbh ,If Replace(TextVariable, NewLine(), "</br>") is not working, try this instead:
Replace(TextVariable, NewLine(), "<br/>")1.NewLine() represents the line break in the text area.2.<br/> is the correct HTML tag for line breaks.
Thanks,Sahana