Please help.

I am having difficulty using the "tab" key to navigate the buttons on a password form I am building for my site.

I found a beautiful piece of code, which works wonderfully, with the exception that I cannot tab to the "login" or "reset" buttons on the form. Tabbing through the fillable input fields works fine, but tabbing to the buttons does not work. Also, the "login" button does not function on a "return" keypress.

I have tried using the "tabindex" attribute, and while this works for the input fields, it does not have any effect on the "Login" or "Reset" buttons. I have tried changing the input type from "login" to "submit", and I have tried changing "onclick" to "onsubmit" (or "onkeypress"), but with these changes, the code doesn't function properly. The "return" key might function, but then the code does not. Never both at the same time.

I have searched all over the web for a solution to no avail. I must admit I am fairly new to html and I do not have the know-how to overhaul the code I'm working with, so I'm asking for help. Does anybody have a solution to my problem?

I want to use the below code, but be able to tab through the input fields, the "login" and "reset" buttons and have these buttons function on a "return" keypress.

Here's the code:




function Getstats()
window.status=('Attempting to Login to user area.')

var AccId;
var iName;
AccId = document.iAccInput.iAccID.value
iName = document.iAccInput.iName.value

if (AccId == "" || iName == "")
alert('\nERROR\nYou must enter ALL Details,\nto View your statistics.\n');
window.status=('Missing data or Invalid. Check spelling and Ensure Names are in Correct Case.')

var location=("pw" + iName + AccId + ".html");
this.location.href = location;
window.status=(' Verifying: ' + iName + '-' + AccId + ' Please wait........');



<div id="main_text">
<h2 class="style3">REEL</h2>
<p class="style1">&nbsp;</p>
<FORM NAME="iAccInput">
<TABLE BORDER="0" border-color=#000000>
<TD ALIGN="RIGHT" class="style1"><p>Client Name:<br />

<TD><INPUT tabindex="1" TYPE="TEXT" NAME="iName" MAXLENGTH="15"><br />
<input tabindex="2" type="password" NAME="iAccID" MAXLENGTH="15"></TD>
<TD><input tabindex="3" TYPE="button" VALUE=" Login " onClick="Getstats()" HEIGHT="40" WIDTH="50"><BR />
<input tabindex="4" TYPE="RESET" VALUE=" Reset " onClick="window.status=('RESET: Please enter your CLIENT NAME and PASSWORD.')" WIDTH="50">


Again, I want to be able to tab through the input fields, the "login" and "reset" buttons and have these buttons function on a "return" keypress. There's gotta be a way. Please help!