- Posts: 2
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
If Statement within unordered List
- jaricianci
- Topic Author
- Offline
- New Member
Less
More
10 months 3 weeks ago #244491
by jaricianci
If Statement within unordered List was created by jaricianci
LimeSurvey version: Version 5.6.26+230613
Own server
==================
I want to add a list element within an unordered list using an if-statement. This does not seem to work. Other HTML Code within if-statements work fine so far:
<p>Title:</p>
<ul>
<li>List element 1</li>
<li>List element 2</li>
{if(TOKEN:ATTRIBUTE_1=="B",''<li>List element 3</li>,'')}
</ul>
Limesurvey auto adds list items to the code turning the above code to:
<p>Title:</p>
<ul>
<li>List element 1</li>
<li>List element 2</li>
<li>{if(TOKEN:ATTRIBUTE_1=="B",''</li>
<li>List element 3</li>
<li>,'')}</li>
</ul>
Does anyone know how to correctly add a list item within an unordered list via if-statement?
Thanks for your help,
Own server
==================
I want to add a list element within an unordered list using an if-statement. This does not seem to work. Other HTML Code within if-statements work fine so far:
<p>Title:</p>
<ul>
<li>List element 1</li>
<li>List element 2</li>
{if(TOKEN:ATTRIBUTE_1=="B",''<li>List element 3</li>,'')}
</ul>
Limesurvey auto adds list items to the code turning the above code to:
<p>Title:</p>
<ul>
<li>List element 1</li>
<li>List element 2</li>
<li>{if(TOKEN:ATTRIBUTE_1=="B",''</li>
<li>List element 3</li>
<li>,'')}</li>
</ul>
Does anyone know how to correctly add a list item within an unordered list via if-statement?
Thanks for your help,
Please Log in to join the conversation.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10121
- Thank you received: 3599
10 months 3 weeks ago #244492
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 If Statement within unordered List
It is the editor doing that.
Use the editor in source mode (personal settings) or try placing your expression on the same line as the last list item.
Use the editor in source mode (personal settings) or try placing your expression on the same line as the last list item.
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: jaricianci
Please Log in to join the conversation.
- jaricianci
- Topic Author
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 0
10 months 3 weeks ago #244493
by jaricianci
Replied by jaricianci on topic If Statement within unordered List
Thank you very much, changing the editor in the personal settings to source-code editor fixed it!
I had the pop-up editor enabled, but Limesurvey always changed it before saving.
I had the pop-up editor enabled, but Limesurvey always changed it before saving.
Please Log in to join the conversation.