Because sometimes asterisk is not good enough to distinguish a required field from others - or you want it to look custom.
theme_form_required_marker() was added in D7.
Add this to your template.php:
/**
* Returns custom HTML for a marker for required form elements. * * @param $variables * An associative array containing: * - element: An associative array containing the properties of the element. * * @ingroup themeable */function mytheme_form_required_marker($variables) { // This is also used in the installer, pre-database setup. $t = get_t(); $attributes = array( 'class' => 'form-required', 'title' => $t('This field is required.'), ); return '<span' . drupal_attributes($attributes) . '>.' t('NB!') .'</span>';}
It's quiet in here! Why not leave a response?
Leave a Response