I'm working on a version of CiviCRM installed in Joomla, I'm using a registration form with custom fields of Civi for the registration. The problem is that CiviCRM does not apply the same checks on passwords as Joomla does. I have not found solutions in the system, so I'm trying to insert custom controls using hooks. As indicated I created a file and specified the path and customize the code find on CiviCRM guide for my purpose, but does not detect any changes on the form I'm using.
function joomla_civicrm_validateForm( $formName, &$fields, &$files, &$form, &$errors ) {
if ($formName == 'Edit') {
foreach ($fields['cms_pass'] as $key => $password) {
if(strlen(trim($password)) > 8) {
$errors['cms_pass[' . $key . ']'] = ts('Password must be 8 characters');
}
}
}
return;
}