dalawh Posted June 29, 2012 Share Posted June 29, 2012 I have a form that looks like this. I currently have it set up using two div tags. The left side is one and the right side is another. If I have my cursor in the Email Address input and press TAB, it goes to Password input. I want to set it up where it looks exactly the same, but when I press TAB, it goes to Confirm Email Address input. Basically, I am wondering how I could align my page without using separate tags, so when I press TAB, it goes to the next one. Link to comment Share on other sites More sharing options...
Ingolme Posted June 30, 2012 Share Posted June 30, 2012 You can use the tabindex attribute for that. Link to comment Share on other sites More sharing options...
dalawh Posted June 30, 2012 Author Share Posted June 30, 2012 You can use the tabindex attribute for that.Thanks for the tabindex. If I only use that attribute for the 6 inputs, how will tab work outside that? Is there a better another way of aligning them without using div tags and put set distance between them or aligning them to an area? Link to comment Share on other sites More sharing options...
Ingolme Posted June 30, 2012 Share Posted June 30, 2012 If, for example, you start off with a tabindex 5 and go on through 6, 7, 8, 9 and 10, then the browser will tab through every other element it finds until the fifth time you press the tab. Then it will go through the form inputs and, after that, it will continue the way it normally would through the elements that haven't been used yet. If you want a different way to set up the form elements, another option is to have six individual <div> elements with a fixed width, float them to the left and use clear: left on every second one. Link to comment Share on other sites More sharing options...
dalawh Posted June 30, 2012 Author Share Posted June 30, 2012 Well, thanks for this. Guess I will stick with the 2 divs. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now