1

I have text button:

<input type="text" class="field" id="something" name="something" placeholder="text" autofocus   />

And i would like to remove android soft keyboard and stay in this field (stay in focus). But i need to do that only for this field not for entire document. Is it possible to do that using jQuery?

Klapsius
  • 3,001
  • 5
  • 24
  • 47
  • Try this https://stackoverflow.com/questions/8335834/how-can-i-hide-the-android-keyboard-using-javascript – Ankita Oct 03 '17 at 11:56

1 Answers1

0

Yes but then you would need to make the field readonly. But this ofcourse means you can't edit it unless you make other UI to manipulate the field value.

What is the goal of the field?

You can for example use blur() to remove focus, and remember in JS what field you had your focus on to do other stuff. But you will still remove the focus.

Also there are more tricks but this will require blur, focusing other fields or making your field uneditable by soft-keyboard.

How can I hide the Android keyboard using JavaScript?

HTML Mobile -forcing the soft keyboard to hide

Timmetje
  • 7,571
  • 16
  • 36
  • When PHP returns error exception i need to be able to scan another value but i need to control screen size (hide soft keyboard) – Klapsius Oct 03 '17 at 12:03
  • Well now you know how to hide they keyboard, choose the trick that works for you. – Timmetje Oct 03 '17 at 12:07