Skip to content
easeweb
Search topics

Form fields that reject full-width digits without saying why

A checkout's phone field takes only the digits 0 to 9, so the same number typed with a Japanese input method on, in full-width digits, is called invalid or deleted as it is typed.

WCAG 2.2
SC 3.3.1ASC 3.3.3AA
Required by
JIS X 8341-3 (Japan) · Section 508 · EN 301 549 (EU)
Broken /^[0-9]{10,11}$/.test(tel.value)
The accessibility problem illustrated: Cognitive:My number is right. What's wrong?
01

The problem

People typing with a Japanese input method on have a correct phone number refused, or deleted as they type it, with nothing to say why.

02

Try it

Type the phone number with the Japanese input above the form, then press Continue.

  • Broken 1: does the page take the number, and if not, does it say why? The input method types it in full-width digits, the same number to anyone reading it. Then type 0123456789 yourself and compare.

  • Broken 2: type with the input method again and watch the field as the digits go in. Does the page say what happened?

  • Apply a fix. Type with the input method and press Continue: does the page take the number, or say which digits to use?

Broken Can you fix this?

Japanese input (simulated):

Delivery

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Convert full-width digits before checking the number, or say to use half-width ones.

  1. 1Convert full-width digits and hyphens before checking, or name the width in the message.
  2. 2Never delete characters from a field as they are typed.
  3. 3Check again on the server, with the same conversion and the same words.
Before

A check that says only that the number is invalid

<form>  <label for="tel">Phone number</label>  <input id="tel" name="tel" type="tel" autocomplete="tel"    aria-describedby="tel-error">  <p id="tel-error"></p>  <button type="submit">Continue</button></form>
After

Convert the digits, then check them

<form>  <label for="tel">Phone number</label>  <input id="tel" name="tel" type="tel" autocomplete="tel"    aria-describedby="tel-error">  <p id="tel-error"></p>  <button type="submit">Continue</button></form>

04

Verify the fix

6 checks, no mouse.

Test with: Input method (IME), Keyboard, Screen reader

0 of 6 checked

Record the OS, browser, input method and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the shared form field or its validation changes.

Limits

This is a starting pattern, not a guarantee for every application. The example is one phone field with a fixed number of digits; postcodes, card numbers and amounts need their own rules after the conversion, and a number with a country code needs a + kept. The replace takes out spaces and dashes, not brackets, so a number written as 03(1234)5678 gets the message; add brackets to it if your customers write them. A kana field that refuses hiragana or half-width katakana is the same failure: NFKC turns half-width katakana into full-width, and each hiragana letter becomes its katakana by a fixed step in Unicode, but that field has no guide of its own yet. How a message reaches people after a failed submission, by focus or by an error summary, is covered in form errors that don't say how to fix them.

This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.

Keep this fixed as your code changes.

Turn guides like this into rules your coding agents and CI follow, then have the result retested with a keyboard and screen readers.

How retests work