-
the friendly canadian
'Tabbing' input textboxes.
I am having a problem tabbing through some input text boxes that i have on a site im designing.
The structure is like this:
Code:
_________ _______ _____________
| login box | | submit | | password box |
What's happening when I tab, is that it will go from login to 'submit' but never go to 'password box'. is there a way to change this order? Whether it goes from login to PW, then to submit, or whether it will just tab login, submit, PW.
Any insight would be appreciated,
DavuLf
edit: it has better graphics in flash
-
Banned
Hi,
Create a tab index of the items you want in focus and the order of the focus when the tab key is pressed...
code:
loginInstanceName.tabIndex=1;
submitInstanceName.tabIndex=2;
passwordInstanceName.tabIndex=3;
-
Mental Ward Patient
oh thats how u do it, i was also wondering how u set up the tabbing.
-
the friendly canadian
NTD you're a genius. Thanks a bunch for that.
-
the friendly canadian
Another quick point to ask, is there a way to make it so when you've tabbed to the submit button, that by hitting enter it will go (or if you just hit enter in general it will go?)
-
Banned
Go where? To the next textbox in the tabIndex list? You can use the setFocus method for something like that.....
This demo uses onKeyUp(cause I am feeling lazy and I already have something like this in another demo)....
you can extend it to the enter key
code:
t2=myTextFieldInstanceName;
myListener= new Object();
myListener.onKeyUp = function () {
Selection.setFocus(t2);
}
Key.addListener(myListener);
-
the friendly canadian
I'm not sure I grasp how that works, but that isn't the point.
If you ever fill out a form via html or php, when you hit enter the submit button posts the variables/checks them and comes back.
My 'go' button does the same thing. So I've set it up so I tab UN, PW, go. Now, what I want to do is after I've typed in a password, if I hit 'enter' then it will submit the values (ie, click on the 'go' button). I suppose I could have an if statement with setFocus on the password box, and if the keypress is enter, then it acts like the submit button, but I'd rather go through the button itself.
-
Banned
Hi,
I misunderstood what you were after. In the button release code, add keypress"<enter>"....
code:
on(release, keyPress "<Enter>"){
//do something;
}
-
the friendly canadian
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|