named-only-by-a-placeholder
This fails the run. Where it is wrong about your code, // ramonda-check-ignore <reason> on the line says so, and the reason is printed on every run.
Reported when a form control's only name is its placeholder, which disappears as soon as anybody types.
A placeholder IS a name, which is why this is not the "no label" report — but it is a name that only exists while the field is empty. The moment somebody types, the one thing saying what the field is for is gone.
Nobody sees that while writing the form, because a form is written empty. It shows up for the person interrupted halfway through, the person checking their answers before submitting, and anybody whose autofill has just filled six boxes and cleared six explanations at once. Placeholder text is also low-contrast by every browser's default.
Give the control a real name and keep the placeholder for what it is good at — an example of
the format. <label htmlFor={id}>Email</label> with placeholder="[email protected]" says
both things, and neither one disappears.
Next
- All rules — the other checks this one runs beside.
- Checking your app — how to run it, and what it proves.