-
Notifications
You must be signed in to change notification settings - Fork 723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change focus when input field was equal with maxlength #482
Comments
If you look at the wiki page, you'll see this demo listed as "Enter a serial number in sequence". Interestingly enough, I was just helping someone through email and we came up with this demo $(function() {
$("input").keyboard({
position: {
// position under center input
of: $("input:eq(1)"),
// move down 12px; not sure why it doesn't line up
my: 'center top+12',
at: 'center top'
},
enterNavigation: true,
maxLength: 4,
layout: 'num',
autoAccept: true,
usePreview: false,
change: function(e, keyboard, el) {
var len = keyboard.$el.hasClass("last") ? 4 : 3;
if (keyboard.$el.val().length >= len) {
// switchInput( goToNext, isAccepted );
keyboard.switchInput(true, true);
} else if (keyboard.$el.val() === "" && keyboard.last.key === "bksp") {
// go to previous if user hits backspace on an empty input
keyboard.switchInput(false, true);
}
}
});
}); |
it's work, but if use alwaysOpen function doesn't work? |
When you set I set the |
okee, I'll wait for the sequel |
Sorry for taking so long! I finally fixed this problem! Here is an updated demo: https://jsfiddle.net/Mottie/bwpc31nj/10/ Make sure to set:
|
i will make input automaticly change focus to next input if input field was equal with maxlength, the input field has been integrated with Mottie Keyboard, it's possible to do that?
Here's DEMO : JSFIDDLE
If no use Virtual Keyboard it's easy use this code:
when i combine script above with Mottie Keyboard, it's doesn't work.
Sorry for my bad english, Thanks!
The text was updated successfully, but these errors were encountered: