Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsUse <input type=”tel”> for a phone-number field in an HTML form. It treats the value as text rather than a number, so users can enter a country code, spaces, parentheses, hyphens, an extension, or telephone characters such as * and #.
The important limitation is that type=”tel” does not validate a phone-number format. That is deliberate: phone formats differ between countries. Add only the constraints your application can genuinely support, and validate the submitted value again on the server.
Basic HTML phone-number field
This is a complete, usable form:
<form action=”/submit-phone” method=”post”>
<label for=”phone”>Phone number</label>
<input id=”phone” name=”phone” type=”tel” autocomplete=”tel”>
<button type=”submit”>Submit</button>
</form>
Each attribute has a separate job:
| Attribute or element | Purpose |
|---|---|
| type=”tel” | Creates a telephone input and may prompt a mobile browser to show a telephone keypad. |
| id=”phone” | Connects the input to its label through for=”phone”. |
| name=”phone” | Names the value in submitted form data. Without name, the field is not included in the submission. |
| autocomplete=”tel” | Tells the browser that this is a complete telephone number, including a country code where applicable. |
| action=”/submit-phone” | Specifies the application endpoint. Replace it with your actual route. |
| method=”post” | Sends the form data in the HTTP request body rather than appending it to the URL. |
The label text and button text are supplied by you; browsers do not require the label to say “Phone number” or the button to say “Submit.”
Why use type=”tel” instead of type=”number”?
A telephone number is an identifier, not a quantity for arithmetic. A tel input stores text, which allows values such as:
#1 Best Overall
- Can't Connect the Bluetooth? Please reset the keyboard and then reconnect the Bluetooth: 1. Turn on the keyboarad; 2. Press and hold the first and the last key at the top row of the keyboard until all indicators start flashing; 3. Bluetooth light flickers quickly, auto entering Bluetooth pairing mode (If not, press Fn + 1 or 2); 4. Search and find "Wireless keyboard".
- Multi-OS Compatible: The keyboard is widely compatible with Android, Windows and iOS devices. Also the basic typing function works with other OS devices such as fire tablets.
- Connect 2 Devices: Seamless switching between 2 Bluetooth devices (iOS/Android/Windows) with single-tap transitions (Fn+"1"/ "2").
- Orange Keys for Productivity Boost: The color-coded design help you to position the keys effortlessly and reduce mistyping. The orange keys are more visible than standard keys, engineered for speed typists.
- Compact & Travel-Friendly: Only 6oz weight and slim 0.6in profile fits in most handbags. The flexible hinge allows you to fold it up for travel – perfect for coffee shops, flights, or campus life.
- +1 555 123 4567
- (555) 123-4567
- 020 7946 0958
- +44 20 7946 0958 ext. 123
- 555-123-4567
A number input is the wrong control because numeric controls are designed for quantities and can reject or mishandle formatting characters. They can also introduce number-specific behavior such as steppers. Use tel when the user is entering a telephone value, even if your backend later normalizes it to digits or international E.164 format.
Make the phone number required
Add required when the user must provide a value:
<label for=”phone”>Phone number</label>
<input id=”phone” name=”phone” type=”tel” required>
The browser’s constraint validation prevents normal submission when the field is empty. However, required only checks that a value exists. It does not determine whether the value is a real, reachable, or correctly formatted phone number.
Also note that required has no effect on a readonly input. A readonly value may still be submitted if the field has a name, but the browser does not require it to be non-empty.
Use pattern for a known local format
If a form serves one country or explicitly requires one display format, add a pattern:
<input id=”phone” name=”phone” type=”tel” required pattern=”[0-9]{3}-[0-9]{3}-[0-9]{4}” title=”Enter a phone number in the format 555-123-4567″>
This accepts 555-123-4567 and rejects values such as 5551234567, (555) 123-4567, or 555-123-45678. The pattern is matched against the complete value, not just a section of it.
HTML’s pattern value is a JavaScript regular-expression pattern without surrounding slash characters. Write [0-9]{3}-[0-9]{3}-[0-9]{4}, not /[0-9]{3}-[0-9]{3}-[0-9]{4}/.
Include a title that explains the required format. “Phone number” is not enough because it does not tell the user what the pattern accepts.
Rank #2
- Maximize Screen Space: Enjoy up to 50% more usable display for ultimate productivity
- Magnetic Support: Features a built-in magnetic array for secure. It instantly attaches to accessories like power banks, stands, and car mounts for greater convenience in daily use
- System Shortcut Keys: Gain one-tap access to essential actions, streamlining your IOS workflow
- Precision Cutouts: Guarantees easy access to all essential ports, microphone, and speakers
- Plug and Play: Simple and quick setup with direct USB connection
Do not apply a US-style pattern as a universal phone validator. It will reject valid numbers from other countries and valid alternative formats from the same country. If your service is international, prefer a country selector plus appropriate application-level parsing and validation.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Limit the text length
minlength and maxlength constrain the length of the entered string:
<input type=”tel” name=”phone” minlength=”7″ maxlength=”20″>
These values count UTF-16 code units, including spaces, parentheses, hyphens, and other characters. They do not count normalized digits and do not represent an international telephone-number standard.
A formatted value may reach maxlength=”20″ sooner than the same number with punctuation removed. Treat these attributes as basic input limits, not as proof that the value is a valid phone number. Your server must also enforce any maximum length because a direct HTTP request can bypass browser restrictions.
Improve mobile input with inputmode
type=”tel” may cause a mobile browser to display a telephone keypad, but the HTML specification does not require a particular keyboard design. You can also provide an input-mode hint:
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware match<input id=”phone” name=”phone” type=”tel” inputmode=”tel” autocomplete=”tel”>
inputmode=”tel” requests a telephone-oriented keyboard, commonly including digits, * and #. It is only a keyboard hint; it does not validate the value.
inputmode=”numeric” requests a digits-oriented keyboard, but it does not enforce digits-only input and is not equivalent to type=”tel”. For a telephone field, use type=”tel” for the field semantics and add inputmode only when its keyboard hint suits your users.
Rank #3
- 【Wide Compatibility】The Wireless Bluetooth cell phone case with keyboard can be folded like a book, also can be unfolded like a microcomputer. Compatible with 4.5''-6.8'' Bluetooth cell phones, including Android, Windows and iOS Phones while allowing easy access to all ports. Light weight, compact, easy to carry and handle, very suitable for working in the office, school, taking notes and typing.
- 【Smart Features】Removable wireless Bluetooth keyboard with magnetic which also has a built-in stand that securely positions your phone at a perfect angle, turning your phone into an easy-to-use laptop in less than a second. After connecting to the keyboard for the first time, it remembers your device and connects automatically when you flip the switch. The light on the keyboard informs the current usage and when we are not using it, we simply press the off button.
- 【Premium Protection】The Wireless Keyboard Case is made of soft PU leather protective and soft microfiber-lined interior which offers unmatched protection to the cell phone and keyboard during use, on the go or in case of accidental knocks or falls. Plastic keyboard is dustproof, scratch-resistant, wear-resistant, high-quality, long service life. With a magnetic keyboard cover that gently closes to turn it into a classic briefcase.
- 【Excellent Touch】The ultra-slim keyboard is easy to carry on your body, and the keys are silent and ergonomically designed to give you a skin-like feel and provide all-day comfort for work and play. Perfect for working, writing or watching videos at work, school, travel and at home.
- 【Quality Assurance】We have very strict control over the quality of our products and we also provide you with high quality customer service and are committed to your satisfaction. If you have any questions, please contact us promptly. We will get back to you within 24 hours.
Use autocomplete correctly
For one complete phone number, use:
<input type=”tel” name=”phone” autocomplete=”tel”>
Other useful tokens include:
| Token | Use |
|---|---|
| tel | A complete telephone number, including country code where applicable. |
| tel-national | A telephone number without the country code. |
| tel-local | A local telephone number. |
| tel-local-prefix | The local number’s prefix. |
| tel-local-suffix | The local number’s suffix. |
| tel-extension | A telephone extension. |
For a billing or shipping contact field, a contextual value such as autocomplete=”billing tel” or autocomplete=”shipping tel” is appropriate. Autofill remains a browser and user-agent decision; the attribute does not guarantee that a value will be offered.
Accessible labels, hints, and placeholders
Keep a visible label and use a placeholder only as an example:
Recommended Free Tools
<label for=”phone”>Phone number</label>
<input id=”phone” name=”phone” type=”tel” placeholder=”+1 555 123 4567″ aria-describedby=”phone-help”>
<small id=”phone-help”>Include the country code.</small>
A placeholder disappears when the user starts typing, so it is not a replacement for a label. The hint is better placed in visible text associated with the field using aria-describedby. Do not put line breaks in a placeholder.
If you use pattern, make the accepted format clear in the visible instructions and in the pattern’s title. For an international field, say whether users should include a country code and which formats you accept.
Submit and validate the value on the server
Client-side validation improves the form experience but is not a security boundary. Users can remove attributes, disable validation, modify the page, submit scripted requests, or call your endpoint directly. The server should:
- Confirm that the expected form field, such as phone, is present.
- Apply a sensible maximum length before processing or storing it.
- Normalize whitespace and formatting according to your application’s rules.
- Parse the number with an international phone-number library if country-aware validation is needed.
- Store the canonical value separately from the display value when you need consistent searching or messaging.
- Perform a verification step, such as an SMS or voice code, when ownership matters.
HTML validation cannot prove that a number is assigned, reachable, owned by the person submitting the form, or valid in the selected country.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Common reasons a phone field does not submit
| Symptom | Likely cause | Fix |
|---|---|---|
| The field appears on screen but is missing from the request. | The input has no name, or it is disabled. | Add name=”phone” and remove disabled when the value should be submitted. |
| A number containing digits is rejected. | The pattern requires punctuation or a particular layout. | Change the pattern, change the instructions, or remove the pattern for a flexible field. |
| Letters are accepted. | type=”tel” intentionally does not define a syntax. | Add suitable validation, preferably with country context, and repeat it on the server. |
| The value is cut off or fails length validation. | maxlength counts the complete text, including formatting characters. | Increase the limit or normalize according to a documented format. |
| Autofill does not appear. | autocomplete is a hint, not a guarantee; browser conditions and saved user data vary. | Use the correct token and keep the field’s label, name, and form structure clear. |
| The browser does not show the expected keypad. | Keyboard appearance is controlled by the user agent and platform. | Use type=”tel”, optionally add inputmode=”tel”, and do not depend on one keyboard layout. |
A practical international example
For a broadly international contact form, avoid forcing one punctuation pattern. Give the user a clear country-code instruction and impose only a generous application-appropriate length limit:
Rank #4
- Maximize Screen Space: Enjoy up to 50% more usable display for ultimate productivity
- Magnetic Support: Features a built-in magnetic array for secure. It instantly attaches to accessories like power banks, stands, and car mounts for greater convenience in daily use
- System Shortcut Keys: Gain one-tap access to essential actions, streamlining your IOS workflow
- Precision Cutouts: Guarantees easy access to all essential ports, microphone, and speakers
- Plug and Play: Simple and quick setup with direct USB connection
<form action=”/contacts” method=”post”>
<label for=”phone”>Phone number</label>
<input id=”phone” name=”phone” type=”tel” inputmode=”tel” autocomplete=”tel” placeholder=”+44 20 7946 0958″ aria-describedby=”phone-help” required maxlength=”32″>
<small id=”phone-help”>Include the country code, for example +44 20 7946 0958.</small>
<button type=”submit”>Save phone number</button>
</form>
This markup improves labeling, mobile entry, and autofill without pretending that HTML alone can determine whether every international number is valid.
FAQ
What is the correct HTML input type for a phone number?
Use <input type=”tel”>. It treats the value as text and is designed for telephone numbers, including formatted and international values.
Does type=”tel” validate a phone number?
No. It does not impose a syntax because telephone formats vary. Use pattern only for a format you intentionally support, and perform stronger validation on the server.
Should I use type=”number” for phone numbers?
No. Phone numbers are identifiers, not quantities. type=”number” is unsuitable for values containing a plus sign, spaces, parentheses, hyphens, extensions, or other telephone characters.
What does inputmode=”tel” do?
It hints that the browser should offer a telephone keypad. It does not validate the value and does not replace type=”tel”.
Why is my phone number missing from submitted form data?
Check that the input has a name attribute and is not disabled. An input without name is not included in the form data set.
Can HTML confirm that a phone number is real?
No. HTML can apply client-side constraints, but it cannot prove that a number is assigned, reachable, or owned by the user. Use server-side parsing and, when necessary, SMS or voice verification.
The Bottom Line
Start with type=”tel” name=”phone” autocomplete=”tel”, connect it to a visible label, and add required only when the field is mandatory. Use pattern for a deliberately narrow format—not as a universal international validator. Treat inputmode, maxlength, and browser validation as input guidance, then validate and normalize the submitted value on the server.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

