
24/03/2008, 10:48
|
| | Fecha de Ingreso: octubre-2005
Mensajes: 405
Antigüedad: 19 años, 4 meses Puntos: 1 | |
ejecutar con tecla enter. El siguiente formulario pretende que al recibir valor en la variable codigo
verifique, mediante un <enter> :
a) si no tubiese valor mostrar mensaje.
b) si tubiese ejecutar aplicacion (action).
<script language="Javascript">
function validar()
{
ingreso = new String()
ingreso = this.Imagen.codigo.value
if (ingreso.length == 0)
{
alert("Debe ingresar Codigo de producto")
return false
}
return true
}
</script>
<form method="post" name="Imagen" action="../../cgi-bin/imagenpro.sh" Onkeydown="return validar(this)">
<input name="codigo" type="text" maxlength="20" value="" /></td>
</form>
al momento de dar enter, la validacion esta incorrecta.
¿Cómo puedo lograrlo? |