Ver Mensaje Individual
  #5 (permalink)  
Antiguo 23/11/2010, 11:20
Avatar de blonder413
blonder413
 
Fecha de Ingreso: octubre-2010
Mensajes: 58
Antigüedad: 13 años, 7 meses
Puntos: 0
De acuerdo Respuesta: validar minimo de caracteres de un input

listo, lo logre!!!

prueba.php
Código:
<html>
<head>
<title>Documento sin t&iacute;tulo</title>

<script language="javascript" type="text/javascript">
	function valida(){
		if(document.getElementById("texto").value.length <= 7){
			alert('ingrese un nombre de minimo 8 caracteres');
			return false;
		}else{
				document.form1.submit();
		}
	}
</script>

</head>

<body>
<form method="get" action="prueba1" name="form1">
<input type="text" name="texto" id="texto"/>
<input type="button" value="ver" onclick="valida()"/>
</form>
</body>
</html>
prueba1.php
Código:
		<?php
	$con=mysql_connect("localhost","root","123");
	$bd=mysql_select_db("prueba",$con);
 $sql="insert into prueba1 values('".$_GET["texto"]."')";
 $res=mysql_query($sql,$con);
 echo "<script type=''>
	alert('El Area de trabajo fue ingresada correctamente');
	window.location='prueba.php'
</script>";
?>