- Posts: 4
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
"<br>" is dropped from attributes
- UmfragenKitzingen
- Topic Author
- Offline
- New Member
Less
More
3 years 2 months ago #210636
by UmfragenKitzingen
"<br>" is dropped from attributes was created by UmfragenKitzingen
Dear forum,
I want to display the address of respondents to allow them to make corrections. Therefore I have a string like "company<br>street 1<br>12345 city" in my csv-file. This worked fine for the last few weeks.
However, as I want to add additional respondents, somehow the "<br>" are now deleted from the string after uploading them from a csv-file. The same is true if I insert them manually.
Does anybody have a solution for this problem? I am using LS 3.25.7.
Many thanks!
I want to display the address of respondents to allow them to make corrections. Therefore I have a string like "company<br>street 1<br>12345 city" in my csv-file. This worked fine for the last few weeks.
However, as I want to add additional respondents, somehow the "<br>" are now deleted from the string after uploading them from a csv-file. The same is true if I insert them manually.
Does anybody have a solution for this problem? I am using LS 3.25.7.
Many thanks!
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
3 years 2 months ago #210643
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 "<br>" is dropped from attributes
Yes, there are issue with this functionnality,
One for functionality : bugs.limesurvey.org/view.php?id=16853
One for security : bugs.limesurvey.org/view.php?id=16884
The solution choosen between : strip tags or just filter was striptags.
Depend where you use your attribute, but with Expression :
Use
Use html encode (must be test) ( > and <)
One for functionality : bugs.limesurvey.org/view.php?id=16853
One for security : bugs.limesurvey.org/view.php?id=16884
The solution choosen between : strip tags or just filter was striptags.
Depend where you use your attribute, but with Expression :
Use
Code:
{str_replace("[","<",str_replace(">","]",TOKEN:ATTRIBUTE_2))}
Code:
{html_entity_decode(TOKEN:ATTRIBUTE_2)}
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 following user(s) said Thank You: UmfragenKitzingen
The topic has been locked.
- UmfragenKitzingen
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 1
3 years 2 months ago #210647
by UmfragenKitzingen
Replied by UmfragenKitzingen on topic "<br>" is dropped from attributes
Thank you very much for your help! Both solutions work for me.
I switched the order of the square brackets within the replace function:
{str_replace("]",">",str_replace("[","<",TOKEN:ATTRIBUTE_1))}
Otherwise it replaced the text after the first part of the string with blank lines (or something similar).
The only drawback is that there is a grey box around the token - but at least I can continue with the format of the survey as it is!
I switched the order of the square brackets within the replace function:
{str_replace("]",">",str_replace("[","<",TOKEN:ATTRIBUTE_1))}
Otherwise it replaced the text after the first part of the string with blank lines (or something similar).
The only drawback is that there is a grey box around the token - but at least I can continue with the format of the survey as it is!
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
3 years 2 months ago - 3 years 2 months ago #210652
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 "<br>" is dropped from attributes
Right : i make an error in the function
Aboyut grey part : Strange ?
Can you send a sample lsa with just one false question andf one false token please ?
Aboyut grey part : Strange ?
Can you send a sample lsa with just one false question andf one false token please ?
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.
Last edit: 3 years 2 months ago by DenisChenu.
The topic has been locked.
- UmfragenKitzingen
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 1
3 years 2 months ago #211064
by UmfragenKitzingen
Replied by UmfragenKitzingen on topic "<br>" is dropped from attributes
Attachments:
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
3 years 2 months ago #211065
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 "<br>" is dropped from attributes
Strange !
I don't understand why this pre tag was added …
Thanks for the LSA, your explanation was clear enough (i understand)
I don't understand why this pre tag was added …
Thanks for the LSA, your explanation was clear enough (i understand)
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.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
3 years 2 months ago #211066
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 "<br>" is dropped from attributes
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.
- UmfragenKitzingen
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 1
3 years 2 months ago #211068
by UmfragenKitzingen
Replied by UmfragenKitzingen on topic "<br>" is dropped from attributes
I see I should have checked this beforehand. A similar problem took me half a day, so I was basically aware of the downsides of copy/paste.
Again, thank you very much!
Again, thank you very much!
The following user(s) said Thank You: DenisChenu
The topic has been locked.