jQuery Mobile Force hide soft keypad on focusing text input field

texens picture texens · Nov 1, 2011 · Viewed 9.9k times · Source

I have a date field on a PHP website and I'm using jQuery Mobile for mobile site.

While browsing the site on a mobile browser, (eg firefox mobile on android), on clicking on the date text input, the calendar dialog comes up, but the soft keyboard also comes up on my android (Soft keypad comes up whenever one focuses on a input field) Is there a way, I can force hide the soft keyboard ? Is there a generic javascript based trick to force hide the soft keypad (that works on all mobile devices like iphone, android etc ?

I'm using the jQuery Mobile datepicker from here TIA

Answer

mdurchholz picture mdurchholz · Aug 8, 2013

A more simple solution is to add readonly="true" to the input boxes that you have the datepicker attached to. Even though you can't manually type in a date, on mobile you won't have to deal with the keyboard popping up and getting in the way