mikeInCali
09-15-2005, 01:49 AM
This is the code i have in my jsp, but I have to click on the image link to submit the form. The client wants to be able to hit the enter key and login. I'm using struts. Can anyone help, please?
<html:form action="/logon" focus="username" onsubmit="return validateLogonForm(this);">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="5"><spacer type="block" width="1" height="1"></spacer></td>
</tr>
<tr>
<td class="InformationText"><bean:message key="prompt.username"/></td>
</tr>
<tr>
<td><html:text property="username" size="15" maxlength="15"/></td>
</tr>
<tr>
<td height="5"><spacer type="block" width="1" height="1"></spacer></td>
</tr>
<tr>
<td class="InformationText"><bean:message key="prompt.password"/></td>
</tr>
<tr>
<td><html:password property="password" size="15" maxlength="25" redisplay="false"/></td>
</tr>
<tr>
<td height="10" nowrap><spacer type="block" width="1" height="1"></spacer></td>
</tr>
<tr>
<td><html:link href="javascript:logonFormBean.submit();"><html:img src="images/g_login_btn.gif" alt="Login" width="46" height="7" border="0" /></html:link></td>
</tr>
</table>
</html:form>
<html:form action="/logon" focus="username" onsubmit="return validateLogonForm(this);">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="5"><spacer type="block" width="1" height="1"></spacer></td>
</tr>
<tr>
<td class="InformationText"><bean:message key="prompt.username"/></td>
</tr>
<tr>
<td><html:text property="username" size="15" maxlength="15"/></td>
</tr>
<tr>
<td height="5"><spacer type="block" width="1" height="1"></spacer></td>
</tr>
<tr>
<td class="InformationText"><bean:message key="prompt.password"/></td>
</tr>
<tr>
<td><html:password property="password" size="15" maxlength="25" redisplay="false"/></td>
</tr>
<tr>
<td height="10" nowrap><spacer type="block" width="1" height="1"></spacer></td>
</tr>
<tr>
<td><html:link href="javascript:logonFormBean.submit();"><html:img src="images/g_login_btn.gif" alt="Login" width="46" height="7" border="0" /></html:link></td>
</tr>
</table>
</html:form>