Ver Mensaje Individual
  #16 (permalink)  
Antiguo 12/12/2008, 14:48
maue75
 
Fecha de Ingreso: noviembre-2008
Mensajes: 288
Antigüedad: 15 años, 5 meses
Puntos: 2
Respuesta: submit() al presionar ENTER

Esta es otra posibilidad de resolver el tema. Probado en IE y Firefox:
( está en el foro, en el rubro Javascript, la dió panino5001: http://www.forosdelweb.com/f13/funci...7/#post2703345 )

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
<script>
function checkBuscar()
{
var x = document.f_buscar.buscar.value.replace(/ /g, '');
if( x == '' )
{
alert ("Debe ingresar alguna palabra a buscar.");
return false;
}
if( x.length < 3 )
{
alert ("Las palabras deben tener 3 o mas letras.");
return false;
}
}
</script>
</head>

<body>
<form id="f_buscar" name="f_buscar" method="post" action="procesar.php" onsubmit="return checkBuscar()">

<input type="Image" src="buscar.gif" >
<input name="buscar" type="text" >
</form>
</body>
</html>