- Posts: 409
- Thank you received: 34
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Custom end message based on condition
- blocka
- Topic Author
- Offline
- Platinum Member
Less
More
4 years 4 months ago #191181
by blocka
Custom end message based on condition was created by blocka
I have a survey where the last question is:
Do you want to enter our contest?
If they reply Yes, I'd like on the End Message to display the link to enter the contest. I thought I could do this
{if(Q37=='A2', '<img src=/upload/surveys/341578/images/ipad.png style=float: left; height: 233px; width: 180px; /><br/><a href=http://example.com target=_blank>
<p>This keeps your previous questionnaire responses anonymous.</p>', 'Thank you for completing the survey<br/>You can now close your web browser.')}
But instead, I get this output:
What am I doing wrong?
Do you want to enter our contest?
If they reply Yes, I'd like on the End Message to display the link to enter the contest. I thought I could do this
{if(Q37=='A2', '<img src=/upload/surveys/341578/images/ipad.png style=float: left; height: 233px; width: 180px; /><br/><a href=http://example.com target=_blank>
Click here to be taken to another site where you can provide us with your contact information.
<p>This keeps your previous questionnaire responses anonymous.</p>', 'Thank you for completing the survey<br/>You can now close your web browser.')}
But instead, I get this output:
What am I doing wrong?
Attachments:
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11758
- Thank you received: 2753
4 years 4 months ago #191184
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Custom end message based on condition
I think you can't use HTML code within an equation, that is the problem.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- blocka
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 409
- Thank you received: 34
4 years 4 months ago - 4 years 4 months ago #191185
by blocka
Replied by blocka on topic Custom end message based on condition
Figured it out: use double quotes around the HTML, single quotes around elements, and DO NOT leave any spaces between tags -- any spaces between tags causes the parsing error.
So, my condition works when it is coded like this:
So, my condition works when it is coded like this:
Code:
{if(Q37=="A2", "<center><p><img style='height: 233px; width: 180px;' src='/upload/surveys/341578/images/ipad.png' alt='' /></p><h2><a href='https://example.com'>Click here to be taken to another site where you can<br/> provide us with your contact information.</a></h2><p>This keeps your previous questionnaire responses anonymous.</p></center>", "Thank you for completing the Survey<br/>You can now close your web browser.")}
Last edit: 4 years 4 months ago by blocka.
The following user(s) said Thank You: DenisChenu
The topic has been locked.