3

I'm using jquerymobile, but can't get the keypad to only show numeric keys (including decimals). Only default keypad is shown.I'm using phonegap, I use

<input type="number">

the problem is that the numpad is shown but when i use

input {-webkit-user-modify: read-write-plaintext-only;}

the default keypad is only shown. Any suggestion would be great.

Thankx.

ANonmous Change
  • 798
  • 3
  • 10
  • 32
  • http://www.bielousov.com/2012/android-label-text-appears-in-input-field-as-a-placeholder/ – Sam Jun 04 '13 at 04:06
  • @Sam where to add line breaks – ANonmous Change Jun 04 '13 at 04:11
  • try to remove `-webkit-user-modify: read-write-plaintext-only;` gains `focus` and on `blur` add it back. what do you think? – Omar Jun 04 '13 at 09:10
  • @Omar if -webkit-user-modify: read-write-plaintext-only; is removed on focus then no use of it on input box, on blur on need of it? – ANonmous Change Jun 04 '13 at 10:04
  • I mean the problem is caused by `-webkit-user-modify: read-write-plaintext-only;` right? and at the same time if fixes duplicate input problem. So if you removed it on input `focus`, the numpad will popup instead of the alpha keyboard. Once the input loses focus (`blur`), add it back in order not to face any problem with duplicate input. – Omar Jun 04 '13 at 10:09
  • if -webkit-user-modify: read-write-plaintext-only; removed on input focus, then it dont fixes duplicate input problem. Duplicate input aries only on focus. – ANonmous Change Jun 04 '13 at 10:16
  • maybe u can use `setTimeout` to remove it. – Omar Jun 04 '13 at 10:18
  • can u enlight with few line of code? – ANonmous Change Jun 04 '13 at 10:20
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/31178/discussion-between-omar-and-anonmous-change) – Omar Jun 04 '13 at 10:21

1 Answers1

0

use $('#<element-id>').focus();

Abdulqadir_WDDN
  • 658
  • 6
  • 22