- Posts: 213
- Thank you received: 38
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Change label for default "Return to Survey" button in upload file modal
- ritapas
- Topic Author
- Offline
- Elite Member
Less
More
3 years 11 months ago #199035
by ritapas
Change label for default "Return to Survey" button in upload file modal was created by ritapas
Hello,
a customer with Limesurvey 2.6.6LTS asked me to change the default label of many survey buttons in a custom theme. In brief, they want to show the survey as an "application form".
I cannot access to the filesystem so I cannot change the translation files.
XSS filter is on.
I've managed to change the label for the Back, Exit and clear, Captcha text in the template.js
However, I cannot find a way to change the "Return to survey" button in the "upload file" modal form, because at "document.ready" it is not still present.
The modal form is as in the attached picture.
Any hints?
Regards
Rita
a customer with Limesurvey 2.6.6LTS asked me to change the default label of many survey buttons in a custom theme. In brief, they want to show the survey as an "application form".
I cannot access to the filesystem so I cannot change the translation files.
XSS filter is on.
I've managed to change the label for the Back, Exit and clear, Captcha text in the template.js
Code:
$(document).ready(function(){ var previousText = "Back"; $('#moveprevbtn .ui-button-text').text(previousText); var clearAllText = "Exit and clear the application"; $('#clearall .ui-button-text').text(clearAllText); var captchaText = "Please confirm access to the application by answering the security question below and click continue."; $('#welcome p .captcha').text(captchaText); var loadAllText = "Load unfinished application"; $('#loadallbtn .ui-button-text').text(loadAllText); // THIS WON'T WORK // var returnToSurvey = "Back to the application" $('.dialog-upload .ui-dialog-buttonpane .ui-dialog-buttonset .ui-button-text').text(returnToSurvey); });
However, I cannot find a way to change the "Return to survey" button in the "upload file" modal form, because at "document.ready" it is not still present.
The modal form is as in the attached picture.
Any hints?
Regards
Rita
Attachments:
The topic has been locked.
- ritapas
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 213
- Thank you received: 38
3 years 11 months ago #199074
by ritapas
Replied by ritapas on topic Change label for default "Return to Survey" button in upload file modal
P.S.:
if after having opened the upload modal form I type the following code in the JavaScript Console, the button label changes as expected.
if after having opened the upload modal form I type the following code in the JavaScript Console, the button label changes as expected.
Code:
var returnToSurvey = "Back to the application"; $('.dialog-upload .ui-dialog-buttonpane .ui-dialog-buttonset .ui-button-text').text(returnToSurvey);
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13637
- Thank you received: 2491
3 years 11 months ago #199098
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 Change label for default "Return to Survey" button in upload file modal
Old version here, the jqueryui, maybe try
api.jqueryui.com/dialog/#event-open
?
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: ritapas
The topic has been locked.
- ritapas
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 213
- Thank you received: 38
3 years 11 months ago - 3 years 11 months ago #199114
by ritapas
Replied by ritapas on topic Change label for default "Return to Survey" button in upload file modal
Yes Denis,
this works, thank you so much!!!
For the others like me who don't know much about JQuery this is the way I did:
1. The dialog is already initialised with the open callback function;
2. This code has been added outside the document.ready()
I hope this can help some other newbies like me.
Thank you again.
Rita
this works, thank you so much!!!
For the others like me who don't know much about JQuery this is the way I did:
1. The dialog is already initialised with the open callback function;
2. This code has been added outside the document.ready()
Code:
$(document).on("dialogopen", ".dialog-upload", function(event, ui) { var returnToSurvey = "Back to the application"; $('.dialog-upload .ui-dialog-buttonpane .ui-dialog-buttonset .ui-button-text').text(returnToSurvey); });
I hope this can help some other newbies like me.
Thank you again.
Rita
Last edit: 3 years 11 months ago by ritapas.
The topic has been locked.