Bienvenue, Invité
Nom d'utilisateur : Mot de passe : Se souvenir de moi

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

Conditional line break (in if(...)) il y a 11 mois 3 jours #101697

  • jonsen
  • Portrait de jonsen
  • Hors ligne
  • Senior Lime
  • Messages : 73
  • Remerciements reçus 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
L'administrateur a désactivé l'accès en écriture pour le public.

Conditional line break (in if(...)) il y a 11 mois 2 jours #101767

  • jonsen
  • Portrait de jonsen
  • Hors ligne
  • Senior Lime
  • Messages : 73
  • Remerciements reçus 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
Dernière édition: il y a 11 mois 2 jours par jonsen. Raison: correct typos
L'administrateur a désactivé l'accès en écriture pour le public.

Conditional line break (in if(...)) il y a 11 mois 2 jours #101772

  • tpartner
  • Portrait de tpartner
  • Hors ligne
  • LimeSurvey Team
  • Messages : 4271
  • Remerciements reçus 806
  • Karma: 369
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.
L'administrateur a désactivé l'accès en écriture pour le public.

Conditional line break (in if(...)) il y a 11 mois 1 jour #101787

  • DenisChenu
  • Portrait de DenisChenu
  • En ligne
  • Moderator Lime
  • Messages : 6444
  • Remerciements reçus 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
L'administrateur a désactivé l'accès en écriture pour le public.
Cet utilisateur a été remercié pour son message par: jonsen

Conditional line break (in if(...)) il y a 11 mois 1 jour #101816

  • jonsen
  • Portrait de jonsen
  • Hors ligne
  • Senior Lime
  • Messages : 73
  • Remerciements reçus 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
L'administrateur a désactivé l'accès en écriture pour le public.
Modérateurs: ITEd
Temps de génération de la page : 0.140 secondes
Donation Image