Welcome, Guest
Username: Password: Remember me

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

Conditional line break (in if(...)) 11 months 2 days ago #101697

  • jonsen
  • jonsen's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 73
  • Thank you received: 6
  • Karma: 1
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
The administrator has disabled public write access.

Conditional line break (in if(...)) 11 months 1 day ago #101767

  • jonsen
  • jonsen's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 73
  • Thank you received: 6
  • Karma: 1
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: 11 months 1 day ago by jonsen. Reason: correct typos
The administrator has disabled public write access.

Conditional line break (in if(...)) 11 months 1 day ago #101772

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4270
  • Thank you received: 803
  • Karma: 368
Cheers,
Tony Partner

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

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Conditional line break (in if(...)) 11 months 15 hours ago #101787

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6429
  • Thank you received: 840
  • Karma: 249
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
The administrator has disabled public write access.
The following user(s) said Thank You: jonsen

Conditional line break (in if(...)) 11 months 7 hours ago #101816

  • jonsen
  • jonsen's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 73
  • Thank you received: 6
  • Karma: 1
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
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.100 seconds
Donation Image