Jump to:

2002 Posts in 1422 Topics by 616 members

Form Questions

SilverStripe Forums » Form Questions » hiding value in ConfirmedPasswordField

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 350 Views
  • sajok
    Avatar
    Community Member
    82 Posts

    hiding value in ConfirmedPasswordField Link to this post

    Hello,

    I have a member profile edit page with a ConfirmedPasswordField that shows two fields to check the password. The problem is when a member visits this page to edit their profile, they see both password fields with long dotted passwords. I tried to hide that password value and show blank fields instead using this code:

    $password = new ConfirmedPasswordField('Password',null,null,null,false);

    $password->setCanBeEmpty(true);

    $member->Password = '';

    this works and shows blank password fields, but when I save the form without making any changes, the password get overridden and I can no longer login with the old password.

    In this api page for the ConfirmedPasswordField class, somebody suggested to add $member->Password = ''; before $form>saveInto() and not calling writ(), but the write call() is already their under saveInto();

    I just want to shows black fields for password instead of the long dotted value.. any help?

    350 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.