powermail icon indicating copy to clipboard operation
powermail copied to clipboard

form field -> description-field usage as description, maybe better accessibility

Open Teisi opened this issue 9 months ago • 1 comments

Can we treat the db field of a form field “description” differently? Currently the field “description” is displayed as label-title-attribute, which I find confusing because the field is called “description” but is used as title and also because this field is not displayed visibly. This also means that no further information can be displayed, for example: what should be entered in the field or in what form.

Currently for example:

<label for="powermail_field_url" class="form-label powermail_label" title="My Field Description">Url</label>
<input .... />

I would suggest improving this by changing this to:

<label for="powermail_field_url" class="form-label powermail_label" aria-labelledby="powermail_field_description_{field.marker}">Url</label>
<input .... />
<div id="powermail_field_description_{field.marker}">{field.description}</div>

Image

And if you really want to keep a title attribute, provide a separate new field for it.

"Conversely, content being put in the title attribute is being hidden from the (probable) majority of your users. If information is being hidden from the majority of your users, then it's likely not necessary." https://www.a11yproject.com/posts/title-attributes/

Teisi avatar Jun 03 '25 15:06 Teisi

Hi @Teisi,

great suggestion. I would integrate it as follows:

<label for="powermail_field_url" class="form-label powermail_label">Url</label>
<input type="text" id="powermail_field_url" aria-describedby="powermail_field_description_{field.marker}" />
<p id="powermail_field_description_{field.marker}">{field.description}</p>

See also Example 1: Using aria-describedby to associate instructions with form fields.

deoostfrees avatar Sep 20 '25 06:09 deoostfrees

Hi @Teisi,

I've implemented it, and it will be included in the next major update.

deoostfrees avatar Jan 19 '26 07:01 deoostfrees