Home Forums Bug Reports invalid HTML in acf_form output for message field


invalid HTML in acf_form output for message field

  • The output of acf_form for a message field uses a <label> element with the “for” attribute. Accoring to the spec: “If the attribute is specified, the attribute’s value must be the ID of a labelable element in the same Document as the label element.” But, of course, there’s no labelable form element on a message field.

    For reference, the output for a message field looks like this:

    <div data-key="field_5581906f89bba" data-type="message" class="acf-field acf-field-message acf-field-5581906f89bba field_type-message field_key-field_5581906f89bba form-header">
    	<div class="acf-label">
    		<label for="acf-field_5581906f89bba">[message label]</label>
    	<div class="acf-input">

    I doubt this is getting in anybody’s way, but I thought I’d at least point it out.

  • Hi Hazard,

    Thanks for noticing! I think the reason for the message field type using a label like all the other field types is because there’s some styling to the label element.

    I’ll be sure to make an improvement request for this for future updates!

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘invalid HTML in acf_form output for message field’ is closed to new replies.