Fix Form Fields That Lose Their Labels When Visitors Type

Keep a visible label next to every input and associate it with the input in HTML. Use a placeholder for an optional example such as a date format. The label should still identify the field after autofill or an error.

1. Start with the filled state

Type into every input or use a test profile to exercise autofill. Ask which field is for a delivery phone and which is for a billing phone. In a hypothetical contact form with two numbers, a blank-field example can make both look identical once data is entered. Give each input a distinct visible name that includes the distinction readers use.

2. Inspect the relationship

For a text input, a label with a matching for attribute and input id is a straightforward association. IDs must be unique across the actual page, including repeated components. Selecting the label should focus its input where that behavior applies. In the accessibility inspector, read the accessible name alongside any description. A date format or length requirement belongs in supporting text when users need to refer to it while editing.

3. Repeat after submission fails

Use dummy details and intentionally leave one required field blank in a test environment. Check that labels remain readable with errors, that each error can be matched to a field, and that the field still has the same name. Remove any duplicate placeholder that merely echoes the label. Confirm touch and keyboard users can reach the same inputs and read the persistent instructions.

Sources

댓글

이 블로그의 인기 게시물

소니 A6000 Wi-Fi 전송 (컴퓨터로 보내기)

SVN 서버 설치 및 웹 접속 설정-Ubuntu 14.04

VirtualBox(VM) 화면 크기 조절