Ver Mensaje Individual
  #24 (permalink)  
Antiguo 15/05/2007, 17:38
Avatar de eits
eits
 
Fecha de Ingreso: junio-2005
Ubicación: valladolid, yucatán
Mensajes: 1.655
Antigüedad: 18 años, 10 meses
Puntos: 88
Re: ayuda en input type

aqui esta el código que hice, prueba y comentas, lo hice con un poco de prisa así que es posible que haya algun error.
Código PHP:
<HTML>
<HEAD>
<TITLE>Modificar Cliente - ROL</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251">
<LINK HREF="style.css" TYPE="text/css" REL="stylesheet">
<script language="javascript">
function recargar()
    {
        valor=document.forms['form'].rut.value;
        //   ooooooooooooo   jjjjjjjjjjjjjj  oooooooooooooooo
        //cambia nombreDeEstaPagina por el nombre actual que tiene esta hoja
        window.location.href='nombreDeEstaPagina.php?rut='+valor;
    }
</script>
<style type="text/css">
<!--
.Estilo1 {    color: #6E6E6E;
    font-family: Tahoma;
    font-weight: bold;
}
.Estilo4 {    font-family: Tahoma;
    color: #6E6E6E;
    font-size: 12px;
    image:Fotos/fyer.gif;
}
.Estilo5 {    color: #3399FF;
    font-family: Arial, Helvetica, sans-serif;
}
-->
</style>
</HEAD>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 rightmargin="0" bottommargin="0">
<center>
  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"  width="763" height="258">
    <param name="movie" value="Flash/header.swf" />
    <param name="quality" value="high" />
    <embed src="Flash/header.swf" quality="high" type="application/x-shockwave-flash" width="763" height="258"></embed>
  </object>
  <TABLE WIDTH=763 BORDER=0 CELLPADDING=0 CELLSPACING=0>
  <!--DWLayoutTable-->
    <TR>
      <TD width="763"><!--DWLayoutEmptyCell-->&nbsp;</TD>
    </TR>
    <TR>
      <TD height="350" valign="top">            <TABLE WIDTH=763 BORDER=0 CELLPADDING=0 CELLSPACING=0>
        <!--DWLayoutTable-->
        <TR>
          <TD HEIGHT=20 colspan="3" background="images/2t1.gif" ><div style="padding-top:3px;padding-left:24px " class="head"><img src="images/img.gif" align="absmiddle">&nbsp; Modificar Usuario </div></TD>
          </TR>
        <TR>
          <TD WIDTH=416 rowspan="3" valign="top" ><div style="padding-top:15px;padding-left:30px;padding-right:25px; line-height:12px ">
            <strong> </strong>
            <p class="Estilo4">&nbsp;</p>
               <p class="Estilo4"> 
                         <?
//Conexion con la base
mysql_connect("localhost","root","");

//seleccion de la base de datos con la que vamos a trabajar
mysql_select_db("repuestos");

echo 
'<FORM name="form" METHOD="POST" ACTION="upname.php">Rut<br>';

//Creamos la sentencia SQL y la ejecutamos
$sSQL="Select * From clientes Order By rut";
$result=mysql_query($sSQL);
echo 
'<select name="rut" onchange="recargar();">';
//Generamos el menu desplegable
while ($row=mysql_fetch_assoc($result))
    {
        if(empty(
$_GET['rut']))
            {
                
$rut=$row["rut"];
            }
        
$sel=($rut==$row["rut"])?'selected="selected"':'';
        echo 
'<option value="'.$row["rut"].'" $sel>'.$row["rut"].'</option>';
    }
echo 
'</select>';
  
$result1=mysql_query("select rut,nombre from clientes where rut='$rut' ");
 while (
$data=mysql_fetch_assoc($result1)){  
 echo 
"<input type='text' name='nombre' value='".$data['nombre'] ."'>";  }
 
?>
  <br>
Nombre<br>
<INPUT TYPE="TEXT" NAME="name">
<br>
<INPUT TYPE="SUBMIT" value="Actualizar">
</FORM>&nbsp;</p>
            </div></TD>
          <TD WIDTH=153 HEIGHT=45 >&nbsp;</TD>
          <TD WIDTH=194 >&nbsp;</TD>
          </TR>
        <TR>
          <TD HEIGHT=65 valign="top" ><span class="Estilo5"><a href="modi_user_lname.php">Modificar Apellido</a><br />
              <a href="modi_user_pass.php">Modificar Password</a><br />
              <a href="modi_user_dir.php">Modificar Direccion</a><br />
              <a href="modi_user_comuna.php">Modificar Comuna</a><br />
              <a href="modi_user_city.php">Modificar Ciudad</a><br />
              <a href="modi_user_fono.php">Modificar Telefono</a><br />
            <a href="modi_user_mail.php">Modificar Mail</a></span></TD>
            <TD >&nbsp;</TD>
          </TR>
        <TR>
          <TD HEIGHT=199 >&nbsp;</TD>
            <TD >&nbsp;</TD>
          </TR>
        <TR>
          <TD HEIGHT=21 >&nbsp;</TD>
            <TD >&nbsp;</TD>
            <TD >&nbsp;</TD>
          </TR>
      </TABLE></TD>
    </TR>
    <TR>
      <TD HEIGHT=35 valign="top" background="images/1.gif" ><div align="center" class="menu" style="padding-top:10px; "><span class="menu" style="padding-top:10px; "><a href="index.html" class="menu">Home</a> | <a href="registro.htm" class="menu">Login</a> | <a href="quienessomos.html" class="menu">Nosotros</a> |<a href="misionvision.html" class="menu"> Vision y Mision</a> |<a href="Ubicacion.html" class="menu">Ubicacion</a></span></div></TD>
    </TR>
    <TR>
      <TD HEIGHT=30 valign="top" ><div style="padding-top:15px " align="center">
      <a href="index-2.html" class="copy">AV. ERRAZURIZ 500 SANTA CRUZ. </a>        </div></TD>
    </TR>
</TABLE>
</center>
</BODY>
</HTML>
eche mano de javascript, revisalo y haz el cambio pertinente, lo tengo marcado, esta como por la linea 10.

suerte y saludos.
__________________
El amor es la locura mas lucida que tiene el hombre.- Andres Henestrosa
la tristeza no existe, solo es... la ausencia de la felicidad.