/drupal-required-error-message

Drupal module providing a Form API parameter for custom error message per element

Primary LanguagePHP

Overview

A simple module for developers allowing a user to specify custom message displayed when required form element empty.

See https://www.drupal.org/node/742344 for D8 discussion.

Features

  • Set custom error message:
    $form['message'] = array(
      '#type' => 'textarea',
      '#title' => t('Message'),
      '#required' => TRUE,
      '#required_error' => t('Please enter a message.'),
    );
    
  • Works with any form element.

Installation and configuration