I am working on a system that has several "date" fields, and the "Label" for it is actually a legend. When marked as "required", no red asterisk shows on the form entry. The attached is an image of the field, and then the code is as follows:

<label for="edit-field-last-name-und-0-value">Last Name <span class="form-required" title="This field is required.">*</span></label>

as opposed to:

<legend style="display: block;"><span class="fieldset-title fieldset-legend">Date of Birth </span></legend>
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

usmccampbell’s picture

For the time being, I have done the following to add the asterisk in a custom.js file inside of my theme folder.

// JavaScript Document

(function ($) {
  $(document).ready(function(){
	$('#field-NAME-OF-FIELD-add-more-wrapper .fieldset legend').append('<span class="form-required" title="This field is required.">*</span>');

Version: 7.20 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.