Lorixen.
EN

Phone number fields that accept every customer

Short answer: If you have customers abroad, a phone field that assumes one country's format will reject or mangle their numbers. Use type="tel" so phones show a number keypad, let people type numbers the way they normally write them (spaces, brackets, a leading +), offer a country selector or accept international prefixes, and store a cleaned-up version in a single international format such as E.164 behind the scenes. Validate gently, with a library built for the job, rather than a strict pattern of your own.

Irish businesses take enquiries and bookings from the UK, mainland Europe, North America and further afield. A phone field written with a single format in mind is a small but common reason enquiries never arrive. Here are the mistakes that cause it, and what to do instead.

Mistake 1: forcing a domestic pattern

A pattern such as "must be 10 digits starting with 08" turns away every UK, US or German number. MDN's documentation for <input type="tel"> points out that, unlike email and URL inputs, the browser doesn't validate phone input to a particular format before submission, precisely because telephone number formats vary so much around the world. You can add a pattern attribute, but a strict one recreates the problem.

Instead: accept international numbers by default. If you must restrict, restrict to plausibility (enough digits, allowed characters), not to one country's layout.

Mistake 2: using a plain text or number input

A type="number" field strips leading zeros and the plus sign, shows spinner arrows on desktop, and can misbehave with long numbers. A plain text field works but misses a mobile convenience.

Instead: use type="tel". MDN notes that mobile browsers may present a keypad optimised for entering phone numbers, and that using the specific input type makes custom validation and handling more convenient. Add autocomplete="tel" so browsers can offer the user's saved number.

Mistake 3: rejecting spaces, brackets and dashes

People write numbers with spaces ("087 123 4567"), brackets or dashes, and paste them from contacts. Rejecting those characters creates errors for perfectly valid input.

Instead: accept them in the field and strip formatting characters when you process the value.

Mistake 4: no way to indicate the country

"0871234567" is meaningless without knowing the country. A UK mobile, an Irish mobile and a US number can all look plausible as local digits.

Instead: choose one of two patterns:

  • Country selector plus number field, defaulting to Ireland (or to the visitor's likely country), with the dialling code shown.
  • A single field that accepts a leading + and international numbers, with a hint such as "Include your country code if you're outside Ireland".

The selector is friendlier for forms used mostly abroad; the single field is simpler where most customers are local.

Mistake 5: storing numbers in whatever format they arrived

When numbers sit in your CRM as "087-1234567", "+353 87 123 4567" and "00353871234567", matching duplicates, sending SMS reminders or clicking to call becomes unreliable.

Instead: normalise to one international format when saving. Twilio's glossary page on E.164 summarises that format: numbers start with a +, followed by the country code and the subscriber number, use digits only, are limited to 15 digits in total, and country codes are one to three digits long. Many SMS and calling services expect E.164, so storing it saves conversion later. Keep the original as typed if you want it for display.

Mistake 6: writing your own validation rules

Phone numbering is full of exceptions: different lengths per country, mobile versus landline prefixes, numbering changes over time.

Instead: use a maintained library. Google's open-source libphonenumber, available for Java, C++ and JavaScript (with ports for other languages), describes itself as a library for parsing, formatting and validating international phone numbers. Its documented features include isPossibleNumber (a quick check based on length), isValidNumber (full validation for a region using length and prefix information) and an as-you-type formatter. Many form tools and plugins use it, or a port of it, under the hood.

Use the quick "possible" check to catch obvious typos, and be cautious about rejecting numbers that fail full validation; warn instead, because a rare but real number may not match the library's current data.

Mistake 7: unhelpful error messages

"Invalid phone number" doesn't tell anyone what to change.

Instead: say what's wrong and how to fix it: "This looks too short. Did you include the full number?" or "Please add your country code (for example +44 for the UK)." Show the message next to the field and keep what the user typed.

Mistake 8: making the field required when it isn't needed

Every required field costs completions. If you only need email for a reply, make the phone number optional and explain why you'd like it ("if you'd prefer a call back").

Mistake 9: forgetting the phone numbers you display

The same principles apply to numbers you publish. Show your own number in international format for overseas visitors (+353…) as well as the local format, and use a tel: link so mobile users can tap to call.

A quick specification for your developer

  • type="tel", autocomplete="tel", a visible label
  • Country selector or international hint
  • Accept spaces, dashes, brackets and a leading +
  • Normalise to E.164 on save; keep the original for display if useful
  • Validate with a maintained library; warn on doubtful numbers rather than block
  • Specific, friendly error messages
  • Optional unless genuinely needed

FAQ

What is E.164 format?

An international format for phone numbers: a plus sign, country code and subscriber number, digits only, up to 15 digits, for example +35387… for an Irish mobile.

Should I use a country flag dropdown?

A country selector helps, but flags alone can be ambiguous and hard to scan. Show the country name and dialling code, and let users search the list.

Can I validate that a phone number actually works?

Format validation only checks plausibility. Confirming a number works requires sending a code or calling it, which is worth doing only when you truly need a verified number.

Do I need the phone field at all?

Only if you'll use it. Optional fields with a clear purpose tend to get better data than required ones filled with dummy numbers.

Losing enquiries from overseas customers because your forms don't fit their details? Show us the form and we'll suggest what to change.

Sources

WhatsAppLet’s talk