greggreg
greggreg

Reputation: 12085

Titanium mobile: Input tabindex

I am building a login/signup view in titanium mobile. For animation reasons these forms are aligned next to each other inside a parent view. If a user clicks on the "already have an account?" button, the "signup" form slides into view. All this stuff works just great.

What I can't figure out is how to assign something like the equivalent of a tabindex to the form inputs. Right now, if I click "next" on the keyboard, focus alternates between the two forms, even if I set enabled=false.

Is there a way to emulate tabindex in titanium mobile?

Upvotes: 1

Views: 554

Answers (1)

flumpb
flumpb

Reputation: 1776

You need to add an event listener on the text field:

usernameTxtField.addEventListener('return', function(e) {
    passwordTxtField.focus();
});

passwordTxtField.addEventListener('return', function(e) {
    login();
});

Upvotes: 1

Related Questions