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?
It would probably be easier to replace the whole token message. Something like this at the end of template.js:
Code:
$(document).ready(function() {
// Define the new message
var newMessage = 'We are sorry but you are not allowed to enter this survey.<br><br>\
This invitation has already been used.<br><br>\
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.';
// Insert the new message (only if the token form is missing)
if($('#tokenmessage').length > 0 && $('#tokenform').length == 0) {
$('#tokenmessage').html(newMessage);
}
});
Cheers,
Tony Partner Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. -
Professional support
-
Plugins, theme and development
. I don't answer to private message.
Sorry I faced problem when I were using JavaScript to replace text on #token message.
I changed the token text and token label, but I can't change the warning message in case of invalid token.
I attached the script that I've been using in my survey.
Help me,please!
Thank you so much.