function _form_set_class

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
cis7 form.inc _form_set_class(&$element, $class = array())
cle7 form.inc _form_set_class(&$element, $class = array())
elmsmedia7 form.inc _form_set_class(&$element, $class = array())
icor7 form.inc _form_set_class(&$element, $class = array())
meedjum_blog7 form.inc _form_set_class(&$element, $class = array())
mooc7 form.inc _form_set_class(&$element, $class = array())

Sets a form element's class attribute.

Adds 'required' and 'error' classes as needed.

Parameters

$element: The form element.

$name: Array of new class names to be added.

Related topics

16 calls to _form_set_class()
corolla_fieldset in sites/all/themes/ulmus/corolla/template.php
Returns HTML for a fieldset form element and its children.
tao_preprocess_fieldset in sites/all/themes/ulmus/tao/template.php
Implementation of preprocess_fieldset().
tao_textarea in sites/all/themes/ulmus/tao/template.php
Override of theme('textarea'). Deprecate misc/textarea.js in favor of using the 'resize' CSS3 property.
theme_checkbox in includes/form.inc
Returns HTML for a checkbox form element.
theme_feeds_upload in sites/all/modules/ulmus/feeds/feeds.pages.inc
Theme upload widget.

... See full list

File

includes/form.inc, line 4207
Functions for form and batch generation and processing.

Code

function _form_set_class(&$element, $class = array()) {
  if (!empty($class)) {
    if (!isset($element['#attributes']['class'])) {
      $element['#attributes']['class'] = array();
    }
    $element['#attributes']['class'] = array_merge($element['#attributes']['class'], $class);
  }
  // This function is invoked from form element theme functions, but the
  // rendered form element may not necessarily have been processed by
  // form_builder().
  if (!empty($element['#required'])) {
    $element['#attributes']['class'][] = 'required';
  }
  if (isset($element['#parents']) && form_get_error($element) !== NULL && !empty($element['#validated'])) {
    $element['#attributes']['class'][] = 'error';
  }
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.