Welcome to the LimeSurvey Community Forum

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

Disable password input in token submission

More
8 years 8 months ago #122294 by Samba
Hi,

Is it possible to view what is inputted into the Token (password) field.

We use user input that a person tells over phone, so It is essential that we repeat the input for confirmation.

If its not easily possible, any workaround?

Thanks
Samba
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Online
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 8 months ago - 8 years 8 months ago #122329 by tpartner
Replied by tpartner on topic Disable password input in token submission
You cannot change the type of the password input but you can insert an element to display its value.

Place this at the end of template.js:
Code:
$(document).ready(function() {
  if($('#tokenform #token').length > 0) {
    $('#tokenform #token').after('<span class="token-value" />');
    $('#tokenform #token').on('keyup paste change', function(e) {
      setTimeout(function() { // Pause required for paste
        $('span.token-value').text($('#tokenform #token').val());
      }, 100);      
    });
  }    
});

And, then maybe something like this in template.css:
Code:
span.token-value {
  display: inline-block;
  margin-left: 5px;
  padding: 0 3px;
  background:#EBEBEB;
}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 8 years 8 months ago by tpartner.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 8 months ago #122371 by DenisChenu
Replied by DenisChenu on topic Disable password input in token submission
Hi Tony,

Not sure but this can not work ?
Code:
$(document).ready(function() {
$('#tokenform #token').attr("type","text");
});

really unsure

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.
  • tpartner
  • tpartner's Avatar
  • Online
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 8 months ago #122391 by tpartner
Replied by tpartner on topic Disable password input in token submission
Changing the input type from password is not allowed in some browsers. Safer to insert an indicator element. You could also clone the input to a text type but I don't think that's required here.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 8 months ago #122403 by DenisChenu
Replied by DenisChenu on topic Disable password input in token submission
Oh, yes , right !

Thank's a lot :)

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.

Lime-years ahead

Online-surveys for every purse and purpose