I've had some clients not wanting the uber cool password strength checking in Drupal 6. Well, here's a very short tip how to disable this.
Just add the following in some javascript (your theme, your module, ...)
<script language="javascript">
// disabling password security check
Drupal.behaviors.password = function(context) {
return;
}
</script>
Hooray for behaviors!

Comments
how do you change the generated message?
Any update to this for Drupal6? Otherwise there's an alternative that works using just css. This assumes the form has a background, so works by just hiding the 2 blocks in question:
.password-description.error,
.password-strength {
position: absolute;
z-index: -1;
}
This can be done with drupal_add_js, I use this code in a form alter function for the registration form:
drupal_add_js( "Drupal.behaviors.password = function(context) { return; }", 'inline' );
It's back up now. Thanks for noticing. ;)
egad. where's the snippet?
Thanks for the tip! Very helpful.
Anyway to get rid of the strength feature and keep the password match yes/no? That would be cool.
Also, the strength settings seem severe by default. It can be confusing for general users - a red box usually means something is wrong and you can't go on... and even a password like "dontGuess1t90" gets a "medium" because it doesn't have punctuation. Might not need to nix it all together if could be adjusted so "mycat" gets a thumbs down and "MycAt93" gets a thumbs up. In most circumstances users signing up with the reg form will be assigned very limited permissions anyways - it doesn't need to be a long string of random characters for the level of security I'm worried about.
That my 2 cents. Thanks again!
you can add it to your template.tpl.php file in your theme directory - if you don't have one you can create one and put it in there.
Robert Pope
Yes, you can use it on hook_init with drupal_add_js. Check there for the right paths.
Thanks for the code snippet.
I'm very unsure where to put this code without making it appear on every page.
Couldn't this be done using drupal_add_js() ?
And couldn't that be done inside a hook so he snippet only shows on the right page?
Post new comment