Is it possible to hide the iPad keyboard after entering a value into an input field on a website by hitting the Return key without forcing the user to use the Hide Keyboard key?
Is there something in HTML or jQuery that I can code into my page to force this behavior?
(P.S. Based of my hours of research online, it seems impossible with the way the iPad currently functions. But I would really appreciate any info!)
How to hide the keyboard on iPad devices using the Press Key method. This is useful when there are objects behind the keyboard. To automatically close the keyboard on iPad devices, click on the “Hide Keyboard” button (circled below). To hide the keyboard, use the Press Key method with the HIDE_KEYBOARD Key value.
To hide it, slide your finger down from above the text-entry box and the keyboard will start to disappear. Carry on until only the text-entry box is left. To make the keyboard reappear, tap the text-entry box and it will shoot right back up so text can be entered again.
Hi, Sifgirl - when you are typing on the keyboard on iPad, the "return" key on the right side is the "enter" key. Hope this helps!
You can hide the keyboard by calling the blur
handler on the text input:
$("#textField").blur();
where #textField
is a selector to select the text input. You need to put this line in the right place, which depends on how the form is coded, and in most cases would be in the form's submit handler.
The easiest answer to your question on any input regardless of form submit would be
$('input').keyup(function(event) {
if (event.which === 13) {
$(this).blur();
}
});
Probably a little easier to put in the right place.
Return = Enter key
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With