Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hitting enter on a login page

Status
Not open for further replies.

chaddu1256

IS-IT--Management
Jan 13, 2003
28
0
0
US
Hello everyone I just had a quick question here. I'm updating this webpage and we want to be able to hit the enter key after entering a username/password. I've done this before by changing the button focus when the page loads but the problem im having now is that there are no buttons used on this page and the login button is a .gif image. Some snippets of the code from the page look like this.

<FORM name="login" action="Controller?cmd=login" method="post">
<TABLE border="0" cellpadding="3" cellspacing="0" align="center">
<TR>
<TD align="right"><B><FONT face="Verdana, Arial, Helvetica, sans-serif">Biller ID:</FONT></B>
</TD>
<TD>
<INPUT type="text" name="BillerID" size="12">
</TD>
</TR>
<TR>
<TD align="right"><B><FONT face="Verdana, Arial, Helvetica, sans-serif">Password:</FONT></B>
</TD>
<TD>
<INPUT type="password" name="password" size="12">
</TD>
</TR>
<TR>
<TD colspan="2"> <FONT face="Verdana, Arial, Helvetica, sans-serif" color="FF0000">
<% if ((errors != null) && (!errors.isEmpty())) {out.print(errors.getLastMessage());} %>
</FONT> </TD>
</TR>
<TR>
<TD colspan="2" align="center"> <a href="javascript:OnSubmitClick(document.login,'Controller?cmd=login');"><IMG src="images/login_btn.gif" border="0" alt="Login" width="112" height="20"></a>
</TD>
</TR>
</TABLE>
</FORM>

Would anyone be able to explain to me how to use the enter key to submit this form when a .gif is clicked rather than a button.
 
function processForm(){
document.login.submit();
}

and call the function like this:

<a href="#" onclick="processForm()"><Img src="images/login_btn.gif" border="0" alt="Login" width="112" height="20></a>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top