
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
HTML5 Input Type Number Removes Leading Zero
The leading zero issues may arise when you want to add an international phone number.
To solve this −
<input type="tel" pattern="[0-9]*">
On iOS, the numeric keyboard appears with only numbers.
On Android phones, the "tel" is rightly interpreted but not the pattern.
You can also use −
<input type="text" pattern="[0-9]*" ...
The above will call and display the numeric keypad on iPhone and Android devices.
Advertisements