2

I have a form with a few text fields followed by a couple of radio buttons formatted inside a JQM control group. When a user types in the text box, the phone's default keyboard appears (as it should). But when the user clicks on the first radio control group (and presumably the text box looses focus) the keyboard remains visible. Is there a way to hide it?

Brad
  • 847
  • 1
  • 7
  • 20
  • Possible duplicate of [How can I hide the Android keyboard using JavaScript?](http://stackoverflow.com/questions/8335834/how-can-i-hide-the-android-keyboard-using-javascript) – JD Davis Dec 21 '16 at 04:05
  • Thanks @Jdsfighter, but that looks like a pretty messy solution! I thought that when the user clicks the radio buttons that the input looses focus so the keyboard should disappear automatically. I don't really understand why it remains onscreen. – Brad Dec 21 '16 at 04:08

1 Answers1

0

Try it like,

// you can make a common class and use it as selector
$('input[type="radio"]').on("click",function(){
   $('input').blur();// trigger blur event from all inputs.
});

Hope this will work for you.

Rohan Kumar
  • 38,998
  • 11
  • 69
  • 99