Change token input type to "password"

More
4 years 6 months ago - 4 years 6 months ago #87257 by SGAMaddin
SGAMaddin created the topic: Change token input type to "password"
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: 4 years 6 months ago by SGAMaddin.

Please Log in to join the conversation.

More
4 years 6 months ago #87449 by tpartner
tpartner replied the topic: Change token input type to "password"
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.

Please Log in to join the conversation.

More
4 years 5 months ago #87557 by SGAMaddin
SGAMaddin replied the topic: Aw: Re: Change token input type to "password"
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';});

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now