- Posts: 35
- Thank you received: 3
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
tailoring: custom html tags using expression manager - rich text editor issue
- bebs
- Topic Author
- Offline
- Junior Member
Less
More
11 years 2 months ago #91685
by bebs
tailoring: custom html tags using expression manager - rich text editor issue was created by bebs
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
in order to generate an html code similar to
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.
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
Code:
{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
Code:
<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.
The topic has been locked.
- KRav
- Offline
- Junior Member
Less
More
- Posts: 30
- Thank you received: 5
11 years 2 months ago - 11 years 2 months ago #91720
by KRav
research on BLOGS - Professional LimeSurvey support
Consultant - Templates - Training - JQuery magic - Support - Coding - Survey creation and more..
Contact
Professional LimeSurvey support
info@researchonBLOGS.de
Replied by KRav on topic tailoring: custom html tags using expression manager - rich text editor issue
Did you use:
around your code?
Code:
<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
info@researchonBLOGS.de
Last edit: 11 years 2 months ago by KRav.
The topic has been locked.
- bebs
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 35
- Thank you received: 3
11 years 2 months ago #91725
by bebs
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.
thanks for the help.
B.
Replied by bebs on topic tailoring: custom html tags using expression manager - rich text editor issue
roB2009 wrote: Did you use:
around your code?Code:<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ .. </script>
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.
Code:
<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.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
11 years 2 months ago #91735
by tpartner
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 Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic tailoring: custom html tags using expression manager - rich text editor issue
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 Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.