Hide text in password field

Issue #53 resolved
Henrik Tilly created an issue

When setting new password in admin interface the password is shown in cleartext. Should be hidden.

Could have a checkbox to say "show text".

Comments (2)

  1. Trevor Ferre

    I agree, orig

    ->add('passwordPlaintext', 'text', array('required' => false))
    

    new

    ->add('passwordPlaintext', 'password', array('required' => true))
    

    while you are at it... you change required to true

    as far as implementation add this to the other side of the input

    <span class="input-group-btn">
    <button type="button" class="btn btn-warning showPass" id="togglePassword">Show</button>
    </span>
    

    and js

    $(document).ready(function() {
        $("#togglePassword").click(function() {   
            if($("#togglePassword").hasClass("showPass")) {
                $('#passwordPlaintext').attr('type', 'text');
                $("#togglePassword").text("Hide");
                $("#togglePassword").removeClass("showPass");
            }
            else {
                $('#passwordPlaintext').attr('type', 'password');
                $("#togglePassword").text("Show");
                $("#togglePassword").addClass("showPass");
            }
        });
    });
    
  2. Log in to comment