Skip Navigation

[Resolved] Can I stop the password field prefilling on an edit user form?

This support ticket is created 2 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 7 replies, has 2 voices.

Last updated by MikeS1622 2 years, 9 months ago.

Assisted by: Waqar.

Author
Posts
#2079609

Edit user form pre-fills the password field with the exiting password, but obviously in the edit password scenario the existing password isn't relevant and if anything this is just confusing the user. Can I turn that off?

#2079979

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

form-settings.png

Hi,

Thank you for contacting us and I'd be happy to assist.

In your user form's right settings panel, you'll see a checkbox "Auto-generate Password".
( example screenshot attached )

When checked, the password field won't be included in the form.

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#2081367

Hi, thanks for your response, but I must not have been clear.

I want the password field to be visible. I don't want it to be prefilled with the current password.

#2081369

Hi, thanks for the response, but I must not have been clear enough.

I want the password field to be visible, but I don't want it to be prefilled with the current password.

#2081591

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thanks for writing back.

I've performed some tests with the password field enabled in the user edit form, in a couple of different browsers and can confirm that the form itself doesn't pre-fill the existing password in the field.

In my Firefox and Safari browsers, I see the blank/empty password fields.
( screenshot from Firefox: hidden link )

However, in Chrome (in which I have saved the password in the browser) the password field is filled with the saved password from the browser and not by the form.
( screenshot from Chrome: hidden link )

You're welcome to test and confirm that it's the browser's auto-fill feature and not the form.

#2081717

Okay, understood. How can I stop that happening? It doesn't autofill on the edit password sections of other sites (all using chrome), so there must be a way.

#2083043

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

To add a directive for browsers to stop auto-filling any saved passwords, you can include the following script in your form's "JS editor":


jQuery(".cred-user-form input[type=password]").attr("autocomplete", "new-password");

This should work for most modern browsers.
( ref: hidden link )

#2084513

Perfect, thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.