4

I would like to disable or hide the Keyboard on Android and iOS on specific Input fields.

is this possible? something like

<input type="text" name="date" keyboard="disable" />
Scratch.
  • 333
  • 1
  • 6
  • 15
  • What are you trying to achieve? How is the user supposed to interact with that form field if there's no keyboard? – Pointy Jan 31 '15 at 17:09
  • I use plugins like date-picker, so I don't see the use of the keyboard – Scratch. Jan 31 '15 at 17:12
  • You are almost there. you can **disable** the input field `` and the keyboard will not show up. – frank Jan 31 '15 at 17:17
  • 1
    This however disables the plugin aswell – Scratch. Jan 31 '15 at 17:19
  • is the plugin native based or HTML/JS based? If it is HTML/JS based than you need to attach the date-picker widget to the input field as a tooltip that will show on click/touch to the input field. You can have a look over here as to how it is done in Dojo toolkit over [here](http://dojotoolkit.org/reference-guide/1.10/dojox/mobile/DatePicker.html) and [here](http://dojotoolkit.org/reference-guide/1.10/dojox/mobile/DatePicker.html). Assuming it is something similar that you are trying to do. – frank Jan 31 '15 at 17:26
  • Another link where you can directly test the widget in your mobile browser. Link over [here](http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/mobile/tests/test_DatePicker.html) and [here](http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/mobile/tests/test_DatePicker2.html). The link will work in the desktop browser too, but you will not get a feel of it as compared to a mobile browser – frank Jan 31 '15 at 17:32
  • @frank: ok thanks for the info, I will look up into it. – Scratch. Jan 31 '15 at 17:51

1 Answers1

2

Use this

$('#input').focus(function() {
  this.blur();
});
Aᴍɪʀ
  • 6,664
  • 3
  • 36
  • 48
user3276940
  • 457
  • 4
  • 16