- Posts: 88
- Thank you received: 7
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
conditional html code inside ExpressionScript wiped by richtext editor
- tassoman
- Topic Author
- Offline
- Premium Member
Less
More
2 years 11 months ago #215505
by tassoman
«All your survey answers are belong to us »
conditional html code inside ExpressionScript wiped by richtext editor was created by tassoman
Hello there, I'm writing a "Label Question" just for composing an intuitive interface. This question does a check on answer status, then provide a note with an icon:
The code is working flawless, showing a nice FontAwesome icon. The problem is when I go further editing the question, HTML inside ExpressionScripts disappears and gets wiped by the richtext editor, even if I go in Source Mode. Any hint how can I keep HTML persistent inside ExpressionScript conditional command?
Code:
<p>{if(count(that.QFin1.NAOK) == 2 && count(that.QFin2.NAOK) == 2, '<i class="fa fa-check-square"></i> Questa funzione è stata compilata','<i class="fa fa-pencil-square-o"></i> Questa funzione è incompleta')}</p>
The code is working flawless, showing a nice FontAwesome icon. The problem is when I go further editing the question, HTML inside ExpressionScripts disappears and gets wiped by the richtext editor, even if I go in Source Mode. Any hint how can I keep HTML persistent inside ExpressionScript conditional command?
«All your survey answers are belong to us »
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
2 years 11 months ago #215513
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic conditional html code inside ExpressionScript wiped by richtext editor
Break it up so the editor doesn't try to "fix" it.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: tassoman
The topic has been locked.
- tassoman
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 88
- Thank you received: 7
2 years 11 months ago - 2 years 11 months ago #215515
by tassoman
«All your survey answers are belong to us »
Replied by tassoman on topic conditional html code inside ExpressionScript wiped by richtext editor
My problem is the logic is much more complicated than "2 ANDs", maybe I can save the logic in a variable?
Another problem is the output of "if statement", it's manipulated increasing the mess (i'm running 3.x branch)
This is a sample output of generated HTML:
Code:
{this.COMPLICATED = count(that.QFin1.NAOK) == 2 && count(that.QFin2.NAOK) == 2} <p><i class="fa fa-{if(this.COMPLICATED == 1, 'check-square', 'pencil-square-o')}"></i> {if(this.COMPLICATED == 1, 'Questa funzione è stata compilata.', 'Questa funzione è incompleta.')}</p>
Another problem is the output of "if statement", it's manipulated increasing the mess (i'm running 3.x branch)
This is a sample output of generated HTML:
Code:
<!-- <i class="fa fa-<span id='LEMtailor_Q_5969_2'>pencil-square-o</span>"></i> --> Questa funzione è <span id="LEMtailor_Q_5969_3">stata compilata</span>
«All your survey answers are belong to us »
Last edit: 2 years 11 months ago by tassoman.
The topic has been locked.
- tassoman
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 88
- Thank you received: 7
2 years 11 months ago #215519
by tassoman
«All your survey answers are belong to us »
Replied by tassoman on topic conditional html code inside ExpressionScript wiped by richtext editor
Finally, I simplified "the thing", using UTF8 emoji icons
«All your survey answers are belong to us »
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
2 years 11 months ago #215633
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic conditional html code inside ExpressionScript wiped by richtext editor
Why i'm always on Popup editor ?
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- tassoman
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 88
- Thank you received: 7
2 years 11 months ago #215662
by tassoman
«All your survey answers are belong to us »
Replied by tassoman on topic conditional html code inside ExpressionScript wiped by richtext editor
On LS-3.x PopUp editor is not working when creating a new question, every RichText Popup you ask returns 403 forbidden error. It works only editing already saved questions.
«All your survey answers are belong to us »
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
2 years 11 months ago #215663
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic conditional html code inside ExpressionScript wiped by richtext editor
I cannot reproduce that problem. LS version and environment?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- tassoman
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 88
- Thank you received: 7
2 years 11 months ago #215664
by tassoman
«All your survey answers are belong to us »
Replied by tassoman on topic conditional html code inside ExpressionScript wiped by richtext editor
To me, happens with PHP 7.3 and LS 3.25.x
When I click the popup button trigger, the new windows opens an error page: "invalid group id". Its url is like this:
gid and qid are empty using path options kind of url
When I click the popup button trigger, the new windows opens an error page: "invalid group id". Its url is like this:
Code:
https://test.LS/admin/htmleditor_pop/sa/index/name/question_it/text/[Question:](it)/type/question-text/action/newquestion/sid/832251/gid//qid//lang/en
«All your survey answers are belong to us »
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
2 years 11 months ago #215665
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic conditional html code inside ExpressionScript wiped by richtext editor
I think it's already reported and fixed for the popup.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.