Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/04/2004, 09:33
Avatar de fmmeson
fmmeson
 
Fecha de Ingreso: enero-2002
Ubicación: Tucuman
Mensajes: 401
Antigüedad: 23 años
Puntos: 2
Validar TextEdit y TextArea

hola amigos estoy tratando de validar un formulario que tiene un campo "text" y un "text area" le muestro el codigo

Código PHP:
<HTML>
 <
HEAD>
 </
HEAD>
 <
BODY>

<!--

function 
Validar(form)
{
if (
form.asunto.value == "")
alert("¿¿Y el asunto del mensaje???"); form.asunto.focus(); return;  }
var 
re  = /^([a-zA-Z0-9]{2,4})+$/;
if (!
re.test(mensaje))
alert("¿¿para que queres enviar esto si no tiene un mensaje!!!???"); form.mensaje.focus(); form.mensaje.select(); return;  }
form.submit();
}
// -->

<form method="post" name="form" action="procesar.php">
 <
input type=text name=asunto style="Font-size= 8pt; Font-Face=Tahoma" size="24" maxlength="255">
<
textarea name=mensaje cols=42 rows=7 style="Font-size= 8pt; Font-Face=Tahoma">
</
textarea>
<
input type=submit value=Enviar style="Font-size= 8pt; Font-Face=Tahoma" onClick="Validar(this.form)">
          <
input type=reset value=Borrar name="reset" style="Font-size= 8pt; Font-Face=Tahoma">
</
form>
</
BODY>
</
HTML
el asunto lo valido bien pero el textarea lo quiero validar con expresiones regulares pero no me resulta cualquier ayuda se los agradeceria mucho!!
__________________
Lo que se hace por AMOR esta mas allá del BIEN y del MAL - Friedrich Nietzsche
http://www.hispanogeek.com.ar
Desarrollador IT -