The LimeSurvey Fund-Raiser 2012 is complete. Thank you for donating a total of 25,000 USD!     List of donors »

Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Change token input type to "password"

Change token input type to "password" 6 months 3 weeks ago #87257

  • SGAMaddin
  • SGAMaddin's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 6
  • Thank you received: 1
  • Karma: 0
Hello,

how can I change the input type of the token-input-field?
Currently it is:
<label for='token'>Token:</label><input class='text ' id='token' type='text' name='token' />
and I want it to change it to be
<label for='token'>Token:</label><input class='text ' id='token' type='password' name='token' />
so that the letters aren´t. displayed while typing it.

Is it possibel to change this?
Last Edit: 6 months 3 weeks ago by SGAMaddin.
The administrator has disabled public write access.

Re: Change token input type to "password" 6 months 3 weeks ago #87449

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2853
  • Thank you received: 423
  • Karma: 243
Add this to the end of template.js:
$(document).ready(function() {
	if($('#tokenform')) {
		$('#token').after('<input type="password" name="token" id="token" class="text ">').remove();
	}
});
Cheers,
Tony

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Aw: Re: Change token input type to "password" 6 months 2 weeks ago #87557

  • SGAMaddin
  • SGAMaddin's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 6
  • Thank you received: 1
  • Karma: 0
Thank you for your help but sadly your solution didn´t work out. I managed to create my own with some of your informations. I have this in head of my startpage.pstpl:
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
document.getElementById("token").type='password';
});
</script>

This worked out fine but at the survey page you get a problem: The input-field is displayed at the bottom of the survey.
So I added this code to the description of my first question:
$(document).ready(function() {
document.getElementById("token").style.display='none';});
The administrator has disabled public write access.
  • Page:
  • 1
Moderators: DenisChenu, ITEd
Time to create page: 0.281 seconds
Donation Image