In fact, I think this is a flaw in the way this is coded to begin with, given an item can have multiple classes.
Instead of having
<label for="input_1_2" class="gfield_label">FIELD<span class="gfield_required">*</span></label>
span.gfield_required {color: #FFFFFF; font-weight: bold;}
It makes much more sense to have the code rendered as
<label for="input_1_2" class="gfield_label gfield_required">FIELD<span>*</span></label>
That way the entire required field can be targeted, or just the span for the asterisk.
EDIT
For now I have settled with the following solution, but I doubt it's the best
jQuery(document).ready(function() {
jQuery('label.gfield_label:has(span.gfield_required)').css('color', '#800000');
});
Posted 13 years ago on Wednesday March 9, 2011 |
Permalink