Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Change token input type to "password"

Change token input type to "password" 1 Jahr 10 Monate her #87257

  • SGAMaddin
  • SGAMaddins Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 6
  • Dank erhalten: 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?
Letzte Änderung: 1 Jahr 10 Monate her von SGAMaddin.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Change token input type to "password" 1 Jahr 10 Monate her #87449

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4141
  • Dank erhalten: 768
  • Karma: 349
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Aw: Re: Change token input type to "password" 1 Jahr 10 Monate her #87557

  • SGAMaddin
  • SGAMaddins Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 6
  • Dank erhalten: 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';});
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.237 Sekunden
Donation Image