# Label read-only worksheet fields without relying on placeholders

Canonical: https://githtml.com/guides/label-readonly-html-worksheet-fields
Published: 2026-11-23
Publisher: WaveTech LLC / gitHtml

Give every meaningful worksheet field a persistent label, even when the field is read-only. Placeholder text is not a substitute because it can disappear and may not identify the control reliably. For a purely static report, ordinary labeled text may be clearer than disabled form controls that imply an interaction the reader cannot perform.

## Understand the access barrier

A report exported from a form can contain values inside boxes with no surviving labels. Disabled controls may also be skipped during keyboard navigation, making them a poor default for information that readers must inspect.

## Use a deliberate document pattern

Use label with a matching control identifier when an actual control is appropriate. Distinguish read-only information from unavailable actions. If editing is not part of the document, a description list can communicate the same values without form-state complexity.

1. Keep labels visible and programmatically associated with genuine controls.
2. Choose ordinary text when the artifact is informational rather than interactive.
3. Verify identifiers and reading order after exporting repeated fields.

````html
<label for="environment">Environment</label><input id="environment" value="Staging" readonly>
````

## Check the actual reading experience

Check that the label remains present when the field contains a value and that duplicate identifiers have not connected it to another field.

## Choose between a field and a reported value

Suppose a release worksheet shows Environment, Reviewer, and Approval date as values inside disabled input boxes. The visual arrangement resembles a completed form, but the exported document is not collecting input. A description list or ordinary labeled text may communicate the same information more directly, without suggesting that the reader can edit or submit it. Choose controls only when their behavior serves the reading task, such as selecting and copying a value.

When a genuine text input is read-only, retain a visible label associated through a unique identifier. The readonly attribute applies only to supported controls; it is not a universal replacement for disabled on every element type. Disabled and read-only also differ in focus and form behavior, so do not swap them globally during export. If the source contains interactive selects or checkboxes, decide explicitly how their values should become static information.

Repeated rows are a common source of broken label associations. A generator may duplicate id=environment for every record, causing labels to refer ambiguously or to the wrong control. Use unique identifiers where controls remain, and include row context in the visible reading structure so a value is associated with the right service or release. Check empty values too: an empty box should distinguish not provided from not applicable when that difference matters. Do not rely on placeholder text to carry the field’s name or status. Review the final export with keyboard navigation and ordinary linear reading, confirming that every reported value has persistent context even when no control receives focus.

## Sources and further reading

- [MDN: label](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/label)

## Related guides

- [Give icon-only document links an understandable name](https://githtml.com/guides/name-icon-only-document-links)
- [Remove positive tabindex from document navigation](https://githtml.com/guides/positive-tabindex-reading-order)
- [Do not erase data-table semantics with a presentation role](https://githtml.com/guides/presentation-role-erases-data-table)
- [Let keyboard readers skip a long table of contents](https://githtml.com/guides/skip-long-table-of-contents)

Editorial approach: https://githtml.com/guides/about
