Is there any way to style the label if there is a class in input field. Please find my code below.
<div id="edit-cv-upload-ajax-wrapper"><div class="control-group form-type-managed-file form-item-cv-upload form-item">
<label for="edit-cv-upload-upload" class="control-label">Upload CV <span class="form-required" title="This field is required.">*</span></label>
<div class="controls">
<div id="edit-cv-upload-upload" class="cv-upload form-managed-file">
<input type="file" id="edit-cv-upload-upload" name="files[cv_upload]" size="22" class="form-file error">
<button class="btn form-submit ajax-processed" id="edit-cv-upload-upload-button" name="cv_upload_upload_button" value="Upload" type="submit">Upload</button>
<input type="hidden" name="cv_upload[fid]" value="0">
</div>
<p class="help-block">Files must be less than <strong>5 MB</strong></p>
</div>
</div>
</div>
Validation is giving error class for the input field. So I have to change the label colour if there is error class for input file field.
I tried with label[for=…] and its not working as the error class is coming after the validation. Please help