IPhone : On focus to next input field trigger keypad in Iphone

on Wednesday, April 1, 2015

I am having issues with triggering keypad automatically in Iphone, when focus to next input field is done.


Can any one help with this please.


Following is jquery code I am using.



$('input[class*="form-control"]').keyup(function(event) {
var $this = $(this);
var currentLength = $this.val().length;
var maximumLength = $this.attr('maxlength');
// if we've filled up this input, go to the next if only numerics are entered.
if ( (currentLength == maximumLength) && (!isNaN(this.value))) {
//$('input').eq($(this).index('input') + 1).contentEditable = true;
$('input').eq($(this).index('input') + 1).select();

}
//go to previous input if Backspace or Delete buton is pressed
if((event.which == 8 || event.which == 46) && (maximumLength == 1)) {
$(this).val('');
$('input').eq($(this).index('input') - 1).val('').focus();
}
});

0 comments:

Post a Comment