Ver Mensaje Individual
  #5 (permalink)  
Antiguo 26/03/2008, 09:47
Avatar de zick
zick
 
Fecha de Ingreso: mayo-2007
Ubicación: Los Angeles - Chile
Mensajes: 168
Antigüedad: 17 años
Puntos: 2
Re: Problema Onclick

Espero que esto sea lo que andas buscando

Código HTML:
<html> 
<head> 
   <title>entra sale</title> 
<SCRIPT>
function chequeo(boton){
     
     var long = (form1.a.value.length) ;
     if (long < 1)
	  {
       form1.a.value=boton.value; 
	  }
     else
      {
      form1.b.value=boton.value;
      }
     }

	</script>
</head> 
<body> 
<form  name="form1" id="form1">
<input type="text"  name="a" id="a"  />
<input type="text"  name="b" id="b"  />

<?php 
  
   include("connect.php");
   $result = mysql_query("select Seccion from secciones");
   
   while($row = mysql_fetch_array($result))
{
   
   printf("<input  type='button'  value=%s onclick=chequeo(this) />", $row['Seccion']);
   
}


?>   
</form>
</body> 
</html> 
Salud!!