I cant seem to do password match on User registration page. It does not show the error message even if the fields are not matching.

I have got logintobogon installed. this is used for email confirm filed. But this doesn't work either.

I have tired FAPI Validation but could not get the matching to work. Any help is appreciated.

Best Regards
Shameem

Comments

Jelle_S’s picture

Update Clientside Validation to 7.x-1.37 and use this code:

<?php
/**
 * Implements hook_clientside_validation_form_alter().
 */
function mymodule_clientside_validation_form_alter(&$form, &$form_state, &$js_rules) {
  if (
$form['#form_id'] == 'user_register_form') {
   
$value = array(
     
'element_name' => $form['account']['pass']['pass2']['#name'],
     
'name' => $form['account']['pass']['pass2']['#title'],
    );
   
_clientside_validation_set_equal($form['account']['pass']['pass1']['#name'], $form['account']['pass']['pass1']['#title'], $value, $js_rules);
  }
}
?>
Jelle_S’s picture

Status:Active» Fixed

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

fox mulder’s picture

Issue summary:View changes

I'm not shure, but I think so, hook_clientside_validation_form_alter() does not exist, but hook_clientside_validation_rule_alter() does.

<?php
/**
 * Implements hook_clientside_validation_rule_alter().
 */
function mymodule_clientside_validation_rule_alter(&$js_rules, $element, $context) {
  switch(
$context['type']) {
    case
'form_validate':
      if (
in_array('user_register_validate', $context['functions'])) {
       
$value = array(
         
'element_name' => $element['account']['pass']['pass2']['#name'],
         
'name' => $element['account']['pass']['pass2']['#title'],
        );
       
_clientside_validation_set_equal($element['account']['pass']['pass1']['#name'],  $element['account']['pass']['pass1']['#title'], $value, $js_rules);
      }
      break;
  }
}
?>