The LimeSurvey Fund-Raiser 2012 is complete. Thank you for donating a total of 25,000 USD!     List of donors »

Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:
  • Seite:
  • 1

THEMA: tailoring: custom html tags using expression manager - rich text editor issue

tailoring: custom html tags using expression manager - rich text editor issue 4 Monate 1 Tag her #91685

  • bebs
  • bebss Avatar
  • OFFLINE
  • Senior Lime
  • Beiträge: 45
  • Dank erhalten: 2
  • Karma: 0
Hello.

I would like to concatenate/join a few tree text answers in a single (hidden) equation question, but the html editor does filter my code (even after desactivating the html editor in global settings and allowing for XSS vulnerabilities).

the Expression I'd like to use is
{if((count(q1tx, q2tx, q3tx)>0),
  implode(" ", "<div class='comments'> <p>Your related additional comments:</p>",
    if(!is_empty(q1tx),implode("", "<p class='s", q1q, "'>", q1tx, "</p>"),""), 
    if(!is_empty(q2tx), implode("", "<p class='s", q2q,"'>", q2tx, "</p>"), ""), 
    if(!is_empty(q3tx), implode("", "<p class='s", q3q, "'>", q3tx, "</p>"),""),
    ), "</div>"), "")} 

in order to generate an html code similar to
  <div class='comments'><p>Your related additional comments:</p>
     <p class='sQ1CODEHERE'>Free text answer q1tx content goes here</p>
     <p class='sQ3CODEHERE'>Free text answer q3tx content goes here</p>
  </div>

simply copy-paste the expression above in the "source" view of the question editor, hit "save & close", and even if the expression was valid (at least I think), the logic check on the group/survey fails.

Is there any possible way to achieve this kind of custom generation of html tags using expressions?

thanks.
B.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: tailoring: custom html tags using expression manager - rich text editor issue 4 Monate 1 Tag her #91720

  • ResearchOnBlogs
  • ResearchOnBlogss Avatar
  • OFFLINE
  • Gold Lime
  • Beiträge: 171
  • Dank erhalten: 16
  • Karma: 8
Did you use:
<script type="text/javascript" charset="utf-8">
 
$(document).ready(function(){
..
</script>

around your code?

research on BLOGS - Professional LimeSurvey support
Consultant - Templates - Training - JQuery magic - Support - Coding - Survey creation and more..

Contact
Professional LimeSurvey support
Diese E-Mail-Adresse ist gegen Spambots geschützt! JavaScript muss aktiviert werden, damit sie angezeigt werden kann.
Letzte Änderung: 4 Monate 1 Tag her von ResearchOnBlogs.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: tailoring: custom html tags using expression manager - rich text editor issue 4 Monate 23 Stunden her #91725

  • bebs
  • bebss Avatar
  • OFFLINE
  • Senior Lime
  • Beiträge: 45
  • Dank erhalten: 2
  • Karma: 0
roB2009 schrieb:
Did you use:
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
..
</script>
around your code?

No I did not, as i don't know javascript at all.
Do I need to "echo" or "print" the result of my expression? simply putting it down between the brakets (as below) had no effect.

Would be great if it worked, the only downside would be that I would have no syntax validation on the expression... but I can live with that.
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
 
{here comes my expression that generates custom html tags}
 
}
</script>

thanks for the help.
B.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: tailoring: custom html tags using expression manager - rich text editor issue 4 Monate 21 Stunden her #91735

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 2870
  • Dank erhalten: 429
  • Karma: 246
Is there any possible way to achieve this kind of custom generation of html tags using expressions?

I can't answer that directly, it's something maybe TMSWhite could speak to, but...

You do not need a <script> tag for Expression Manager expressions. These expressions are parsed at the server before page rendering.
Cheers,
Tony

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Der Administrator hat öffentliche Schreibrechte deaktiviert.
  • Seite:
  • 1
Moderatoren: DenisChenu, ITEd
Ladezeit der Seite: 1.222 Sekunden
Donation Image