JSP (Java Server Page) - Fallo con formulario de struts html:password

 
Vista:

Fallo con formulario de struts html:password

Publicado por TT (14 intervenciones) el 19/01/2006 16:05:41
Hola:

Tengo un formulario hecho con el taglib html.

<html:form action="/Login" onsubmit="javascript:validateForm(document.forms[0]);">
<tr>
<td width="25%"><span class="textonegrita"><bean:message key="login.username"/>:</span></td>
<td width="75%"><html:text property="username" styleClass="formcampotxt" size="15"/></td>
</tr>
<tr>
<td><span class="textonegrita"><bean:message key="login.password" />:</span></td>
<td><html:password property="password" styleClass="formcampotxt" size="15" /></td>
</tr>
<tr>
<td><span class="textonegrita"><bean:message key="login.idUser" />:</span></td>
<td><html:password property="userCompany" styleClass="formcampotxt" size="15" /></td>
</tr>
<tr>
<td colspan="2" height="5"></td>
</tr>
<tr>
<td colspan="2"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="32%"><img src="resources/images/espacio.gif" width="67" height="20"></td>
<td width="40%" class="fondoazul"> <div align="center"><html:link href="javascript:validateForm(document.forms[0]);" styleClass="linksuperior"><bean:message key="login.button"/></html:link></div></td>
<td width="28%"><img src="resources/images/espacio.gif" width="67" height="20"></td>
</tr>
<tr>
<html:submit style="visibility:hidden" />
</tr>
</html:form>

El formulario quiero que se valide tanto si pulso enter como si pincho sobre la imagen, pero en explorer no funciona cuando pulso enter y me he dado cuenta de que es por el html:password, si los quito funciona bien, pero no se que debo hacer para que funcione con los campos de password.

Muchas Gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE: Fallo con formulario de struts html:passwor

Publicado por Alvaro (1 intervención) el 19/01/2006 16:30:39
Trata usando javaScript para capturar las teclas, yo tengo una pagina de Login y funciona bastante bien...

<SCRIPT>
function body_onkeydown(){
if( window.event.keyCode == 13){
//aqui invocas un submit
}
}
</SCRIPT>
</head>
<body onkeydown="body_onkeydown()">
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar