I have a jquery mobile site with a html form consisting of 4 pin entry input boxes. I want the user to be able to enter a pin in each input field without having to press the iphone keyboards "next" button. I have tried the following and although it appears to set the focus to the second input and insert the value, the keyboard disappears so the user still has to activate the required input with a tap event.
$('#txtPin1').keypress(function() {
$('#txtPin1').bind('change', function(){
$("#txtPin1").val($("#txtPin1").val());
});
$("#txtPin2").focus();
$("#txtPin2").val('pin2');
});
Is there a different event that I should be assigning to $("#txtPin2")?
I have tried to implement http://jqueryminute.com/set-focus-to-the-next-input-field-with-jquery/ this also, but I found that it worked for android and not for iphone.
Any help is greatly appreciate it.
Live Example: http://jsfiddle.net/Q3Ap8/22/
JS:
HTML:
I tried it on android and it works. I can not check it on iPhone. Check this: http://jsfiddle.net/Q3Ap8/276/ [direct link: http://fiddle.jshell.net/Q3Ap8/276/show/ ]
Other solution that works for android is: http://jsfiddle.net/Q3Ap8/277/ [ http://jsfiddle.net/Q3Ap8/277/show ]