Mobile Safari - How to Default to Full Numeric Keypad for Decimal Entry w/o type="number", or disable Safari input type="number" correction

aohm1989

I have a fairly basic but frustrating problem, essentially I've been trying to force input fields to behave more like text input types (where they do not correct incorrect number entries, such as "0..7" to truncate to "0") and just let JS form validation and backend validation do its job. However, while I want to allow the user to enter whatever they want in the field (input type="text"), I want to FULL numberpad keyboard to display.

Original:

<input type="number" name="test" class="answers" id="mileage" value="0.0" maxlength=5 />

Attempts to fix:

Works on iPad, but NOT on iPods, as iPods display the compact number pad WITHOUT decimal points:

<input type="text" name="test" class="answers" id="mileage" value="0.0" maxlength=5 pattern="\d*"/>

Doesn't work on iPod, as it displays the full text keyboard, but doesn't default to the "number side" of the full keyboard with a decimal:

<input type="text" name="test" class="answers" id="mileage" value="0.0" maxlength=5 pattern="\d+(\.\d*)?"/>

Anyone have any ideas? Either to prevent Mobile Safari from correcting input number types (number types display the correct keyboard on iPods and iPads, but has built in correction on fields when the keyboard hides), or to force the keyboard to be on the Number side of the full iPod keyboard?

FYI: This sounds very similar to my issue, however I may need a different solution. Sounds like they desired the "Full" numeric keyboard to appear by default but without number autoformatting that Safari does on the field when entering other characters in.

Force a numeric keyboard but allow punctuation: HTML5, mobile Safari

tagawa

I know this is old but I see this being asked quite a lot.

To prevent validation of the number input type (and other types) you can use the novalidate attribute on the <form> element:

<form novalidate>
  <input type="number" name="test" class="answers" id="mileage" value="0.0" maxlength=5>
</form>

You'll still get the numeric keyboard but it won't force the user to enter numbers only.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Disable Text Entry in <input type="number">

From Dev

Input type number, decimal value

From Java

Allow 2 decimal places in <input type="number">

From Dev

Firefox - input type number hides decimal places

From Dev

How to disable input on type="number" but only keep spinners usable

From Dev

How to disable keyboard to enter value input type number in jquery?

From Dev

Disable direct value editing in input type="number"

From Dev

AngularJS input type=number default value

From Dev

AngularJS input type=number default value

From Dev

How to Have Drupal WebForm phone number input show a keypad on a mobile device

From Dev

Prevent typing non-numeric in input type number

From Dev

Typed decimal disappears from HTML text input of type 'number' in browser

From Dev

html tag input of type=”number” and culture based decimal separator

From Dev

Angular2 input type number, no decimal value

From Dev

html5 input[type=number] two decimal points

From Dev

Angular2 input type number, no decimal value

From Dev

Decimal dot and thousands separator used both in input type number

From Dev

How to Disallow single decimal point(.)in input field with type number in angular js

From Java

Styling a input type=number

From Dev

Input type number in AngularJS

From Dev

Input type number validation

From Dev

Make Input Type="Password" Use Number Pad on Mobile Devices

From Dev

html5 input type number with regex pattern in mobile

From Dev

input type=number not possible to insert negative numbers on mobile phone

From Dev

input type=number not possible to insert negative numbers on mobile phone

From Dev

iOS safari messes up input type=date

From Dev

Disable webkit's spin buttons on input type=“number” in AngularJS

From Dev

Disable webkit's spin buttons on input type=“number” in AngularJS

From Dev

How to Type Multilingual Characters in Windows Mobile Device by Device Keypad

Related Related

  1. 1

    Disable Text Entry in <input type="number">

  2. 2

    Input type number, decimal value

  3. 3

    Allow 2 decimal places in <input type="number">

  4. 4

    Firefox - input type number hides decimal places

  5. 5

    How to disable input on type="number" but only keep spinners usable

  6. 6

    How to disable keyboard to enter value input type number in jquery?

  7. 7

    Disable direct value editing in input type="number"

  8. 8

    AngularJS input type=number default value

  9. 9

    AngularJS input type=number default value

  10. 10

    How to Have Drupal WebForm phone number input show a keypad on a mobile device

  11. 11

    Prevent typing non-numeric in input type number

  12. 12

    Typed decimal disappears from HTML text input of type 'number' in browser

  13. 13

    html tag input of type=”number” and culture based decimal separator

  14. 14

    Angular2 input type number, no decimal value

  15. 15

    html5 input[type=number] two decimal points

  16. 16

    Angular2 input type number, no decimal value

  17. 17

    Decimal dot and thousands separator used both in input type number

  18. 18

    How to Disallow single decimal point(.)in input field with type number in angular js

  19. 19

    Styling a input type=number

  20. 20

    Input type number in AngularJS

  21. 21

    Input type number validation

  22. 22

    Make Input Type="Password" Use Number Pad on Mobile Devices

  23. 23

    html5 input type number with regex pattern in mobile

  24. 24

    input type=number not possible to insert negative numbers on mobile phone

  25. 25

    input type=number not possible to insert negative numbers on mobile phone

  26. 26

    iOS safari messes up input type=date

  27. 27

    Disable webkit's spin buttons on input type=“number” in AngularJS

  28. 28

    Disable webkit's spin buttons on input type=“number” in AngularJS

  29. 29

    How to Type Multilingual Characters in Windows Mobile Device by Device Keypad

HotTag

Archive