
17/01/2002, 14:40
|
| | Fecha de Ingreso: febrero-2001
Mensajes: 292
Antigüedad: 24 años, 1 mes Puntos: 0 | |
Re: Como dar Enter y que haga submit en netscape No sé si este código es lo mejor, pero funciona...
<pre>
<html>
<head>
<title> New Document </title>
<script language="JavaScript">
<!--
var nav4 = window.Event ? true : false;
function acceptEnter(evt)
{
// NOTE: Enter = 13
var key = nav4 ? evt.which : evt.keyCode;
if (key==13){
document.forms[0].boton.focus();
document.forms[0].submit();
}
}
//-->
</script>
</head>
<body>
<form method=post action="http://www.yahoo.com">
Nombre <input type=text name="nombre" size=12> <br>
Pass <input type=text name="pass" size=12 onKeyPress="return acceptEnter(event)"><br>
<input type="submit" name="boton">
</form>
</body>
</html>
</pre>
<hr noshade size=1 color="#000000"><img src="http://www.gograph.com/Images-8712/ClipArt/cat03.gif" height="50" border=0 align="absmiddle"> <font size="2" face="verdana" color="#000000">bet[/CODE] |