Welcome, Guest
Username: Password: Remember me

TOPIC: Change token input type to "password"

Change token input type to "password" 1 year 8 months ago #87257

  • SGAMaddin
  • SGAMaddin's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 6
  • Thank you received: 2
  • 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: 1 year 8 months ago by SGAMaddin.
The administrator has disabled public write access.

Re: Change token input type to "password" 1 year 8 months ago #87449

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4049
  • Thank you received: 739
  • Karma: 341
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 Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

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" 1 year 8 months ago #87557

  • SGAMaddin
  • SGAMaddin's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 6
  • Thank you received: 2
  • 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.
Moderators: ITEd
Time to create page: 0.223 seconds
Donation Image