Hot answers tagged

1

This is a variation of a frequently asked question. The user login form for Drupal is built using Drupal Form API. In Drupal 7 core, the user login form is declared in user.module: https://github.com/drupal/drupal/blob/7.x/modules/user/user.module#L2111 // Display login form: $form['name'] = array('#type' => 'textfield', '#title' => t('...


1

This: (isset($values['element1'])) will always return TRUE, since the form element exists, and therefore a value is always passed to the submit hander, even when the value is empty. You likely want this: !empty($values['element1'])


Only top voted, non community-wiki answers of a minimum length are eligible