Skip to Content Skip to Menu

Decent password validation

  • nwrightau
  • nwrightau
  • OFFLINE
  • Posts: 16
  • Thanks: 1
  • Karma: 0
10 years 1 month ago #249840 by nwrightau
Decent password validation was created by nwrightau
Hi,


Need to create some decent password validation on our CB registration form.

Something like this: www.webdesignerdepot.com/2012/01/password-strength-verification-with-jquery/

You can currently set the validation but the response messages aren't useful, if you enter the required amount of characters but not capital letters or special characters it won't tell you. It only displays one message and only validates the required amounted of characters.

We need to be able to validate everything and display useful messages to the user.

So, I need to disable all validation on the cb registration form as it's not worth the time to try and get that working - where can I edit the javascript that appears on the registration page?



Thanks

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8283
  • Karma: 1443
10 years 1 month ago #249858 by krileon
Replied by krileon on topic Decent password validation
We do not support core edits so I can't help you in that regard. We use the jQuery Validate plugin, which we've extended in CB 2.0 with our own cbvalidate plugin. Neither will display the invalid message how you're wanting.

Best I can suggest is create a custom validation rule for jQuery Validate, load it in using our cbValidator API, then use a CB plugin to add the data rule to the password field. That would cause your validation rule to be applied, but I don't recommend doing this for CB 1.x as that probably won't work.

When using custom regex validation you should be able to supply a custom invalid message; I recommend just making the message very clear.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • nwrightau
  • nwrightau
  • OFFLINE
  • Posts: 16
  • Thanks: 1
  • Karma: 0
10 years 1 month ago - 10 years 1 month ago #249875 by nwrightau
Replied by nwrightau on topic Decent password validation

krileon wrote: We do not support core edits so I can't help you in that regard. We use the jQuery Validate plugin, which we've extended in CB 2.0 with our own cbvalidate plugin. Neither will display the invalid message how you're wanting.


The 'support' you give you your paying customers is dreadfully unhelpful. 'Core edits' are the only option, because the component is so bad, I'll just have to fish through it until I find it and make the edits I need to - the least you could do is tell me where this section of code is found.

krileon wrote: Best I can suggest is create a custom validation rule for jQuery Validate, load it in using our cbValidator API, then use a CB plugin to add the data rule to the password field. That would cause your validation rule to be applied, but I don't recommend doing this for CB 1.x as that probably won't work.

When using custom regex validation you should be able to supply a custom invalid message; I recommend just making the message very clear.


So, you're suggesting a method that won't work, and just generally saying you're component probably won't work. If we could not use this component at all we would, but we're too far along in the build.

Is there a way to disable all validation for every field easily, or do I have to open every single field [we have near 100 fields] individually and turn that off?
Last edit: 10 years 1 month ago by nwrightau.

Please Log in or Create an account to join the conversation.

  • beat
  • beat
  • ONLINE
  • Posts: 2169
  • Thanks: 463
  • Karma: 352
10 years 1 month ago #249884 by beat
Replied by beat on topic Decent password validation
Hi nwrightau,

The above example you provided is a very nice hand-holding validation method.

I'm wondering why you would need to disable validation on all fields in order to use it ?

We use the jQuery Validate plugin, which you can extend with an independant jquery plugin or just jquery code in the registration page header for the validation of the password field in the way you would like it to be. Core Joomla password validation doesn't work that way either, so it's really custom jQuery javascript code that is needed there, imho.

To add custom jQuery code to that registration page without need for core edits, here is a short how-to:
1) create a Joomla menu for the CB Registration page (CB - Register in Joomla menus manager)
2) install CB Content module and create a module displaying only on that page. It has a field for adding jQuery javascript code to the page header at the right place.
3) into that field, write your jquery validate javascript code for that field
4) disable CB validation on password as you have your custom one, but leave validation on all other fields.

The above method is valid for both CB 1.9.1 and 2.0, but the jquery code might need very minor adaptations (probably 1-2 lines to adapt the binding to CB validation plugin instead of the jquery one, but even that might not be needed).

We do not recommend nor support modified CB versions, as modifying core CB has turned out many times to be a very time-consuming experience for users and for us too, without benefits to the community. Specially that 99.99% of the time, sadly, users don't contribute back their improvements. While looking as a great way to win time upfront, it is very hard to maintain as new versions of Joomla and of CB are released. That's why we have a very stable API that can be used to extend CB, and we have always replied positively to request for additional events/hooks to be added to CB to improve its extensibility through CB plugins or modules. In your use-case, it's not needed since the method above allows you to change the password validation methode without any core hacks.

I hope that is helpful to you. I'm sorry that I don't have time to code your jQuery code for you at this time, and sorry that you didn't like Kyle's reply. I hope that the background in this reply will allow to read it again in a different light :)

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info
The following user(s) said Thank You: nant

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8283
  • Karma: 1443
10 years 1 month ago #249909 by krileon
Replied by krileon on topic Decent password validation
You can add jQuery to the registration and profile edit pages using CB Auto Actions and its Code action. The triggers you'll need are as follows.

onBeforeUserProfileEditDisplay
onBeforeRegisterFormDisplay

Both triggers are fired directly before profile edit and registration form display. By default your fields should have their validation set to Any String (so nothing to shut off). The exception being core fields like Password, Username, and Email which you disable by editing them within CB > Field Management and setting their validation to Any String. Please note that Joomla has some requirements that can not be circumvented for core fields so that validation can't be shut off.

The above should allow you to add whatever jQuery you need to have the validation you're wanting. To protect the PHP side I suggest using a simple regex rule that matches your needs and set the field to use "Custom PERL regular expression" then supply your needed REGEX and shut off browser validation (browser side validation would be from your custom jQuery). The Code action can also actually load and use 3rd party jQuery plugins as well so you could even go the route of using a jQuery plugin that already does what you're wanting.

This should allow you to have what you're wanting without core edits.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • nwrightau
  • nwrightau
  • OFFLINE
  • Posts: 16
  • Thanks: 1
  • Karma: 0
10 years 4 weeks ago #250026 by nwrightau
Replied by nwrightau on topic Decent password validation
Thanks for your response. I've written a custom jQuery plugin to solve the issue and add additional password validation.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum