12-09-2013 12:43 AM
hello all, Is there any way to suspend the keypad after pressing submit button on keypad . pressing on submit button indirectly means that user is done with the keypad, but keypad is not getting suspended. without suspending keypad, there are redraw issues on pages where iscroll is implemented. Are there any events which i can add them to listen during device ready of cordova functions through which i can suspend the keypad forcefully under specific cases other than submit case as described above. please let me know.
Solved! Go to Solution.
12-11-2013 11:52 AM
There are no APIs to open and close the keyboard.
If you are using a <form> with <input> inside, the submit button should (and does) close the keyboard.
<form id="submitForm" action="#"> <input name="q" type="text"/> <input style="display:none" type="submit" title="Search"> </form>
Try the code above and let me know how it behaves for you, also, provide the OS build you are testing this on.
I've used the following implementation (mobile YouTube uses this too):
If you need to close the keyboard, on submit, just remove the DOM node that has the <input> field. This forces the keyboard to close. You can quickly save the data, remove the node, append the node back to DOM and fill with the data. This should be pretty transparent to the user.