Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Modify Label

  • leblancoj
  • leblancoj's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 3 months ago #146221 by leblancoj
Modify Label was created by leblancoj
Hello, I'm New to this world of LimeSurvey.
I'm trying to edit some tags, but I have no idea if I'm on the right track, I am in the option of Survey participants.



Can I change the "Password(Contraseña)" tag? To say "RUT",




My intention is:

Have a text field where the user can add some identifier number and is validated in the database to enter the survey, as there is already a default "password" I would like to change the label and customize it, but I do not succeed, I wanted to edit The source code but I did not get the file to do it.

Can I do this?
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 3 months ago #146250 by holch
Replied by holch on topic Modify Label
You should not change the source. These strings are saved in the language files anyway. So you could create a specific language translation for your installation. Or maybe you can change the string via Javascript, which is probably easier if you only want to change this one string. But with the Javascript solution someone else will have to help.

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.
  • leblancoj
  • leblancoj's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 3 months ago #146258 by leblancoj
Replied by leblancoj on topic Modify Label
As the image shows, access to the survey is restricted and you must enter the password to validate the access and enter. Can be another security token to validate? Like the mail?

Can you do it from the LimeSurvery administration or do you need to alter the source code?
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 3 months ago #146260 by holch
Replied by holch on topic Modify Label
Sorry, now you got me confused. From your first post I understood that you would like to rename "Contraseña" into "RUT". This can be either done by modifying the translation of your chosen language or maybe with a javascript code. I don't get what you want to say with your new post.

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.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 3 months ago #146261 by tpartner
Replied by tpartner on topic Modify Label
To change the label for the token input without going to translations, add something like this to the end of template.js:

Code:
$(document).ready(function() {
  if($('#tokenform').length > 0) {
    $('label[for="token"]').text('New Label');
  }
});


Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • leblancoj
  • leblancoj's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 3 months ago #146263 by leblancoj
Replied by leblancoj on topic Modify Label
OMG!!!! I'll try it and report it
The topic has been locked.
  • leblancoj
  • leblancoj's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 3 months ago #146277 by leblancoj
Replied by leblancoj on topic Modify Label
tpartner:
Add the JS code in template.js at the end but nothing happens :( I'm doing something wrong? Sorry if that's so, I'm new to LimeSurvey

The topic has been locked.
  • leblancoj
  • leblancoj's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 3 months ago #146279 by leblancoj
Replied by leblancoj on topic Modify Label
How can I edit the source code for this form?

I want to change the field where the "password" is entered to enter alphanumeric characters and remove the ************ asterisks that hide what one writes

www.limesurvey.org/media/kunena/attachme...0-11-12-13-14-15.png
The topic has been locked.
More
7 years 3 months ago - 7 years 3 months ago #146281 by Ben_V
Replied by Ben_V on topic Modify Label

leblancoj wrote: Add the JS code in template.js at the end but nothing happens I'm doing something wrong?


perhaps a browser cache issue... retry after clearing it ;)

leblancoj wrote: I want to change the field where the "password" is entered to enter alphanumeric characters and remove the ************ asterisks that hide what one writes


adapting Tony's script:
Code:
$(document).ready(function() {
               if ($('#tokenform').length > 0) {
                   $('label[for="token"]').text('RUT');
                   $('input.text').attr("type","text").removeAttr('type');
               }
  });

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Last edit: 7 years 3 months ago by Ben_V.
The topic has been locked.
  • leblancoj
  • leblancoj's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 3 months ago #146283 by leblancoj
Replied by leblancoj on topic Modify Label

Ben_V wrote:

leblancoj wrote: Add the JS code in template.js at the end but nothing happens I'm doing something wrong?


perhaps a browser cache issue... retry after clearing it ;)

leblancoj wrote: I want to change the field where the "password" is entered to enter alphanumeric characters and remove the ************ asterisks that hide what one writes


adapting Tony's script:
Code:
$(document).ready(function() {
               if ($('#tokenform').length > 0) {
                   $('label[for="token"]').text('RUT');
                   $('input.text').attr("type","text").removeAttr('type');
               }
  });



It does not work, save the JS at the end of the template.js as the image shows and still does not show any changes, clear the entire browser cache
I set the default custom template on my menu but nothing!



The topic has been locked.
More
7 years 3 months ago #146284 by Ben_V
Replied by Ben_V on topic Modify Label
so try to embed the script into your endpage.pstpl file :
Code:
<script>
$(document).ready(function() {
               if ($('#tokenform').length > 0) {
                   $('label[for="token"]').text('RUT');
                   $('input.text').attr("type","text").removeAttr('type');
               }
  });
</script>

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 3 months ago #146287 by tpartner
Replied by tpartner on topic Modify Label

It does not work, save the JS at the end of the template.js as the image shows and still does not show any changes, clear the entire browser cache

In /application/config/config.php, set debug to 1 so all files are loaded directly, not via the assets manager.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose