Paul Neale Paul Neale - 4 years ago 126
jQuery Question

Need to press button twice, first to close keyboard second to send. How do I stop this?

I have a case where I have users that can enter text in a field for a mobile web site.

They then need to press a button to send the message but they have to press it twice, once to close the keyboard and the second to send the message.

The sending is taking place via JQuery Ajax fired from an event handler. I have preventDefault on if that matters.

Is there a way around this?

Answer Source

Remove the focus from the input on button click to hide the software keyboard:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download