Create validation to input alphanumeric and with specified symbols for field type password in user module In the user module for field type password input I want to avoid hazardous characters input so i added #required and '#element_validate. But as i am new to drupal i dont know how to processed and also i am not sure if i am in right direction or not . Please help me 

if (!$register) {
  $form['account']['pass'] = array(
  '#type' =&gt; 'password_confirm',
  '#size' =&gt; 25,
  '#description' =&gt; t('To change the current user password, enter the new password in both fields.'),
   //The below two lines are added by naveena. 
  '#required' =&gt; TRUE,
  '#element_validate' =&gt; array('user_pass_element_validate'),  

);

function user_pass_element_validate($element, &amp;$form_state, $form) {
  if (!empty($element['#value'])) {
    form_error($element, t(''));
  }
}
You should use user_validate_current_pass().