A box that shows one line at a time
Many contact forms show a message field a single line tall. A patient types two sentences, the text scrolls out of sight, and they cannot reread what they wrote without scrolling inside a tiny box. On a phone, with the keyboard covering half the screen, the problem is worse.
A message box is where a patient explains what they need. If it is awkward to use, they shorten the message, skip the details that would help the office call back, or give up.
What MDN says about the textarea
The MDN reference describes the textarea element as a multi-line plain-text control for a sizeable amount of free-form text. It lets you set rows and cols, and MDN recommends setting them for consistency because browser defaults can differ. If cols is not given, the default width is 20 average characters.
MDN also says to connect the box to a label with matching id and for values, and that placeholder text should only show an example of what to type and is not a substitute for a proper label. If no maximum length is set, the user can enter an unlimited number of characters. A maxlength, if you add one, caps what can be typed.
| Setting | What it does for the patient |
|---|---|
| Four to six visible rows | Several lines show at once, so the patient can reread |
| Full width on a phone | The box fits the screen with no sideways scrolling |
| Label above the box | The question stays on screen while typing |
| No maximum length, or a generous one stated in the label | No message is cut off silently |
| Placeholder used for a short example only | Helpful hint that does not replace the label |
A short checklist for your form
- 1Check that the message field is a multi-line box and not a single-line input.
- 2Make it at least four rows tall on a desktop and a phone.
- 3Make it the same width as the other fields, with no sideways scrolling on a phone.
- 4Put a visible label above it, such as How can we help, as described in our guide to visible labels above every field.
- 5If you limit the length, say the limit in plain words before the patient starts typing.
- 6Type a long test message on your phone and confirm the whole message is still readable and that Send is reachable.
Say what not to include
Under the box, a short line such as Please do not include private health details in this message keeps patients from putting sensitive information in an unsecured form. Our guide to the note under a contact form covers the wording.
Last, make sure the error text is helpful if the message is required but empty, as in the form error messages guide. This is practical website guidance and not legal advice.
Frequently asked questions
How many rows should the box have?
MDN does not name a number. Four to six rows is a practical size that shows a few sentences at once. Test on your own phone and adjust to what you can read comfortably.
Should I set a character limit?
Only if your system needs one. Without maxlength the user can enter unlimited text per MDN. If you add a limit, tell the patient before they start so nothing is cut off silently.
Can the box grow as the patient types?
Some designs do this. It works if it stays inside the screen and the Send button remains reachable, so test it on a phone before you keep it.
Is placeholder text enough as a label?
No. MDN says placeholders are only for an example of the data and are not a substitute for a label tied to the field.
Should the message be required?
Often a phone number or email is the required part, and the message is optional. Decide what your office needs to call back, and mark exactly those fields.
Sources
- MDN Web Docs — The HTML textarea element
- W3C Web Accessibility Initiative — Forms Tutorial: Form Instructions