Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/10/2010, 11:47
aprendiz88
 
Fecha de Ingreso: agosto-2010
Mensajes: 62
Antigüedad: 13 años, 8 meses
Puntos: 0
Información Evento onfocus

Hola buen día a todos

Me podrían guiar para poner un evento onfocus en mi formulario, de acuerdo al id, estoy tomando los valores de una bd, actualmente para hacer cambios vuelvo a llenar todos los datos en el formulario lo que necesito es que al seleccionar el id, automáticamente me muestre los datos.

El código del formulario que tengo es este:

Código PHP:
<form action="<?=$PHP_SELF?>" method="post">
<table align="center" cellpadding="3">

  <tr>
    <td width="131" height="40">  <p>Id status de servicio: </p></td>
    <td width="210"><select name="select">
          <option value=>Seleccione una opción </option>
     <?
      $sql
="select idstatusdeservicios,idstatusdeservicios from tblstatusservices";
       
$query=mysql_query($sql);
        while(
$row=mysql_fetch_array($query))
          {
      
?>
      <option value=" <? echo $row[0]; ?>"><? echo $row[1]; ?></option>
      <?php 
      
}
      
      
?>    
    
    </select></td>
  </tr>
  <tr>
    <td height="36"><p>Cabecera de caso: </p></td>
    <td><select name="select2">
         <option>Seleccione una opción: </option>
     <?php
      $sql
="select idstatusdeservicios,cabecera_cliente from tblstatusservices";
       
$query=mysql_query($sql);
        while(
$row=mysql_fetch_array($query))
          {
      
?>
      <option value=" <? echo $row[1]; ?>"><? echo $row[1]; ?></option>
      <?php 
      
}
         
?>    
        </select>  </p></td>
  </tr>
  <tr>
    <td><p align="left">Hostname:    </p></td>
    <td><select name="select3">
      <option>Seleccione una opción: </option>
      <?
        
        $sql
="(Select id,name from tblservers)";
        
$query=mysql_query($sql);
        while(
$row=mysql_fetch_array($query))
        {
        
?>
      <option value="<? echo $row[1]; ?>"><? echo $row[1]; ?></option>
      <?
        
}
        
?>
    </select>
      </p></td>
  </tr>
  <tr>
    <td><p align="left">Servicio:</p></td>
    <td></p>
      <input type="text" name= 
    "serv" size="35" 
    maxlength="" /></td>
  </tr>
  <tr>
    <td> <p align="left">Status:</p></td>
    <td><input type="text" name= 
    "stats" size="35" 
    maxlength="" />

  </p></td>
  </tr>
</table>
  
  <p align="center"> 
    <input type=submit name="submit3" value= 
    "Guardar">
  </p>
</form>
Espero me puedan ayudar

Saludos y gracias