Show password
-
I’m in the process of building a school alumni website that will have a high member involvement and as so will require members young and old to log in and being able to see their passwords in text is a feature I’ve been asked to include.
I know that WordPress’s default login has incorporated this feature but it’s lost when using Theme My Login. Other show password plugins also appear to not be compatible so I’m trying my hand at coding. I’m a newbie at this!
I’m having problems in getting the following coding, placed in theme-my-login-custom.php, to work and as you see from the login page the checkbox is there but the password does not change to text.
Any help in getting this to work would be very much appreciated.
‘// Form template copied from: /wp-content/plugins/theme-my-login/includes/forms.php
<?php
add_action(‘init’, ‘tml_show_pwd’ );
function tml_show_pwd() {
tml_add_form_field( ‘login’, ‘login_form’, array (
‘type’ => ‘checkbox’,
‘id’ =>’user_pass’),
‘label’ => __( ‘Show password – Not working yet!, ok’ ),
‘priority’ => 20,
‘onclick’ => ‘show_hide_pwd()’,
) );
}?>
<script>
function show_hide_pwd( ) {
var x = document.getElementById(“user_pass”);
if (x.type === “password”) {
x.type = “text”;
} else {
x.type = “password”;
}
}
</script>’The page I need help with: [log in to see the link]
The topic ‘Show password’ is closed to new replies.