- Posts: 38
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Using Javascript to replace text on #tokenmessage
- stemate1988
- Topic Author
- Offline
- Junior Member
Less
More
8 years 9 months ago #122643
by stemate1988
Using Javascript to replace text on #tokenmessage was created by stemate1988
Morning,
I have a bit of jquery which i want to use to replace some text in the #tokenmessage.
I want 'Please contact' to be replaced.
$("#tokenmessage p").text($("#tokenmessage p").text().replace("Please contact", "It looks as though you’ve recently completed the survey and provided your feedback. Unfortunately, we’re only able to accept one survey per applicant"));
Is this possible and where would the code have to sit?
I have a bit of jquery which i want to use to replace some text in the #tokenmessage.
I want 'Please contact' to be replaced.
$("#tokenmessage p").text($("#tokenmessage p").text().replace("Please contact", "It looks as though you’ve recently completed the survey and provided your feedback. Unfortunately, we’re only able to accept one survey per applicant"));
Is this possible and where would the code have to sit?
The topic has been locked.
- stemate1988
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 38
- Thank you received: 0
8 years 9 months ago #122649
by stemate1988
Replied by stemate1988 on topic Using Javascript to replace text on #tokenmessage
re-raised in correct area #122647
stemate1988 wrote: Morning,
I have a bit of jquery which i want to use to replace some text in the #tokenmessage.
I want 'Please contact' to be replaced.
$("#tokenmessage p").text($("#tokenmessage p").text().replace("Please contact", "It looks as though you’ve recently completed the survey and provided your feedback. Unfortunately, we’re only able to accept one survey per applicant"));
Is this possible and where would the code have to sit?
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
8 years 9 months ago - 8 years 9 months ago #122667
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 Using Javascript to replace text on #tokenmessage
[strike]Not sure, can you test with p:first ?[/strike]
[strike]There are only one p in tkenmessage ?[/strike]
Hi,
Did you try to put :
In template.js ?
[strike]There are only one p in tkenmessage ?[/strike]
Hi,
Did you try to put :
Code:
$(function() { if($("#tokenmessage p").length){ $("#tokenmessage p").text($("#tokenmessage p").text().replace("Please contact", "It looks as though you’ve recently completed the survey and provided your feedback. Unfortunately, we’re only able to accept one survey per applicant")); } });
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: 8 years 9 months ago by DenisChenu. Reason: fix ....
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
8 years 9 months ago #122672
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 Using Javascript to replace text on #tokenmessage
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.