Conditional line break (in if(...))

More
4 years 2 days ago #101697 by jonsen
jonsen created the topic: Conditional line break (in if(...))
Hi everyone,

does anybody know if it is possible to use a line break in a formula? I need to do if(X==Y,"","\n\n\n"). This is for an email invitation. As I use plain text, I cannot use html like <br /> or similar...

Is it possible?

Thank you very much!

Best
jonsen

Please Log in to join the conversation.

More
4 years 1 day ago - 4 years 1 day ago #101767 by jonsen
jonsen replied the topic: Conditional line break (in if(...))
Okay, so I switched to HTML and used <p>{if(...)}</p>, which actually doesn't produce a new paragraph if there isn't anything in there. This wasn't really what I wanted (which was to stay text-only), but there was no other way...

There seems to be no solution with the break within the formula. "\n" doesn't work, having an actual line break "
" doesn't work, and what I found most annoying, even "<br />" and "<p>" don't work because the editor automatically adds line breaks to format the source code, which then breaks the formula (in which line breaks are obviously not allowed).

So, how about adding support for \n, \t and all the fun stuff?

Best
Jonsen
Last Edit: 4 years 1 day ago by jonsen. Reason: correct typos

Please Log in to join the conversation.

More
4 years 1 day ago #101772 by tpartner
tpartner replied the topic: Conditional line break (in if(...))

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
4 years 1 day ago #101787 by DenisChenu
DenisChenu replied the topic: Conditional line break (in if(...))
Hi,

I don't know for \n BUT the easiest way to update Equation is to use "HTML editor popup" and not inline.
manual.limesurvey.org/First_login_-_Your_user_preferences#Popup

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: jonsen

Please Log in to join the conversation.

More
4 years 16 hours ago #101816 by jonsen
jonsen replied the topic: Conditional line break (in if(...))
Thanks tpartner and Denis! Using <br /> works with the popup editor!

I don't think a feature request is neccessary. I guess the cases in which users actually want to work with \n are too rare. Tell me if you think otherwise.

Best
Jonsen

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!