Skip Navigation

[Resolved] Questions about user forms (CRED plugin)

This support ticket is created 2 years, 2 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 2 replies, has 2 voices.

Last updated by Saul Baizman 2 years, 2 months ago.

Assisted by: Waqar.

Author
Posts
#2471325

Hi there,

I'm using the CRED plugin to create a User Form that allows logged in users to change their WordPress password, and I have a couple of questions:

+ I'd like to require the new password that the user enters to meet certain password complexity requirements (i.e., be a minimum length, include symbols, etc.). I know I can validate the submitted form data with PHP via the cred_form_validate hook; is there a hook that I can use on the frontend to validate the data via JavaScript before it's submitted?

+ The plugin allows me to specify the new password field and verification field the user enters through a native field type. I'd also like the user to have to enter their *current* password, like below:

enter current password: _______
enter new password: _______
enter new password again: _______

Is this possible?

Thank you!

Saul

#2471953

Hi,

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

+ For the frontend validation of the password strength, through JavaScript, you don't need any built-in filter/hook. You can implement the password strength script library of your choice:
hidden link

+ The "current password" field option is not supported, out-of-the-box, so you'll have to include a generic field for this.

Next, you can use a custom function attached to the "cred_form_validate" hook to see if the entered existing password is correct or not, through the "wp_check_password" function:
https://developer.wordpress.org/reference/functions/wp_check_password/

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

regards,
Waqar

#2472179

Thanks, Waqar! I'll follow your links and instructions as I move forward.

Saul