Foros del Web » Programando para Internet » PHP »

Pasar datos a textbox

Estas en el tema de Pasar datos a textbox en el foro de PHP en Foros del Web. Tengo un formulario desde el que envio datos conseguidos con una consulta sql, y esos datos los recibe otra pagina con textbox; y lo que ...
  #1 (permalink)  
Antiguo 13/02/2007, 13:55
 
Fecha de Ingreso: febrero-2007
Mensajes: 8
Antigüedad: 17 años, 2 meses
Puntos: 0
Pasar datos a textbox

Tengo un formulario desde el que envio datos conseguidos con una consulta sql, y esos datos los recibe otra pagina con textbox; y lo que me gustaria es saber como meto los datos recibidos en las distintas textbox.

Muxas gracias.
  #2 (permalink)  
Antiguo 13/02/2007, 14:46
 
Fecha de Ingreso: febrero-2005
Mensajes: 51
Antigüedad: 19 años, 2 meses
Puntos: 3
Re: Pasar datos a textbox

Hola, si es un el textbox es un input de tipo text lo tienes que poner en la propiedad value: <input type="text" value"Lo que queres que se vea">
se el texbox es un textarea tenes que ponerlo entre las etiquetas:

<textarea> Lo que queres que se vea </textarea>

En el caso que los datos esten guardados en una variable tenes que poner en ves de "Lo que queres que se vea" <? echo "$variable"; ?>

Espero que te sirva
Saludos
  #3 (permalink)  
Antiguo 13/02/2007, 14:46
Avatar de FNX_NET  
Fecha de Ingreso: marzo-2004
Ubicación: EN EL INFIERNO.....
Mensajes: 1.707
Antigüedad: 20 años
Puntos: 7
Re: Pasar datos a textbox

<? require('../../conect.php'); ?>
<form action="GuardarAlumno.php" name="Edicion" id="frmEdicion" method="post">
<table width="755" height="48" border="0" align="center" background="../../style/fmr/main_body.gif">

<tr>
<td height="21" colspan="3" class="formHead"><div align="right">Edici&oacute;n</div></td>
</tr>
<tr>
<td height="21">Rut</td>
<td>
<input name="TxtRut" type="text" size="16" onKeyPress="return acceptNum(event)" />-<input name="TxtVer_rut" value="" type="text" size="1"/>
<em><input name="btnBuscar" type="button" id="btnBuscar" value="Buscar" onclick="buscar()" />
</em></td>
<td>&nbsp;</td>
</tr>
</table>
<?php
if($_GET['bsc']==1)
{
$RutBuscar = $_GET['Rbuscar'];
$consulta="SELECT INFORMACION_USUARIO.ID_INFO_USUARIO,INFORMACION_US UARIO.RUT,INFORMACION_USUARIO.DV,INFORMACION_USUAR IO.NOMBRE1,INFORMACION_USUARIO.NOMBRE2, INFORMACION_USUARIO.APELLIDO_PAT,INFORMACION_USUAR IO.APELLIDO_MAT,
INFORMACION_USUARIO.SEXO, to_char(FECHA_NACIMIENTO,'DD') AS DIA, to_char(FECHA_NACIMIENTO,'MM') AS MES,
to_char(FECHA_NACIMIENTO,'YYYY') AS ANO,INFORMACION_USUARIO.NACIONALIDAD,INFORMACION_U SUARIO.DIRECCION, INFORMACION_USUARIO.ID_COMUNA,INFORMACION_USUARIO. ID_CIUDAD, INFORMACION_USUARIO.FONO_FIJO,INFORMACION_USUARIO. FONO_MOVIL,INFORMACION_USUARIO.EMAIL
FROM INFORMACION_USUARIO WHERE INFORMACION_USUARIO.RUT='".$RutBuscar."'";
require('../../header_sql.php');
$sw=0;
if($row = oci_fetch_array ($statement))
{
$TxtId = $row['ID_INFO_USUARIO'];
$TxtRut = $row['RUT'];
$TxtDV = $row['DV'];
$TxtPnombre = $row['NOMBRE1'];
$TxtSnombre = $row['NOMBRE2'];
$TxtPapellido = $row['APELLIDO_PAT'];
$TxtSapellido = $row['APELLIDO_MAT'];
$TxtSexo = $row['SEXO'];
$TxtDia = $row['DIA'];
$TxtMes = $row['MES'];
$TxtAno = $row['ANO'];
$TxtNacionalidad = $row['NACIONALIDAD'];
$TxtDireccion = $row['DIRECCION'];
$TxtComuna = $row['ID_COMUNA'];
$TxtCiudad = $row['ID_CIUDAD'];
$TxtFonoFijo = $row['FONO_FIJO'];
$TxtFonoMovil = $row['FONO_MOVIL'];
$TxtEmail = $row['EMAIL'];
$sw=1;

}
if($sw==0)
{
?>
<script language="javascript">
alert("No se encontraron coincidencias!!");
document.forms['Edicion']['TxtRut'].focus();
</script>
<?
}
else
{
?>
<br />
<table border="0" align="center" background="../../style/fmr/main_body.gif">
<tr>
<td height="21"><a href="EdicionApoderado.php?id=<? echo $TxtId; ?>&Ralumno=<? echo $RutBuscar; ?>" class="Cell-Label">Ver Apoderados</a></td>
<td height="21"><a href="EdicionPadres.php?id=<? echo $TxtId; ?>&Ralumno=<? echo $RutBuscar; ?>" class="Cell-Label">Ver Padres</a></td>
<td height="21">&nbsp;</td>
</tr>
<tr>
<td height="21">&nbsp;</td>
<td height="21"><input type="hidden" style="border:0;" name="RutProfesor" value="<? echo $TxtRut;?>" />
<input name="DvProfesor" type="hidden" style="border:0;" value="<? echo $TxtDV; ?>" size="1" /></td>
<td height="21">&nbsp;</td>
</tr>
<tr>
<td width="143">Nombres</td>
<td colspan="2"><label>
<input type="text" name="TxtPnom" onkeyUp="verificar(this)" onblur="javascript:this.value=this.value.toUpperCa se();" value="<? echo $TxtPnombre; ?>" />
</label>
<label>
<input type="text" name="TxtSnom" onKeyUp="verificar(this)" onblur="javascript:this.value=this.value.toUpperCa se();" value="<? echo $TxtSnombre; ?>" />
</label></td>
</tr>
<tr>
<td height="25">Apellidos</td>
<td colspan="2"><label>
<input type="text" name="TxtPapell"onKeyUp="verificar(this)" onblur="javascript:this.value=this.value.toUpperCa se();" value="<? echo $TxtPapellido; ?>" />
</label> <label>
<input type="text" name="TxtMapell" onKeyUp="verificar(this)" onblur="javascript:this.value=this.value.toUpperCa se();" value="<? echo $TxtSapellido; ?>" />
</label></td>
</tr>
<tr>
<td>Sexo</td>
<td colspan="2">
<?php
if ($TxtSexo=='M' )
{?>
<label><input name="radiobutton" type="radio" value="RbFeme" />Femenino</label>
<label><input name="radiobutton" type="radio" value="RbMascu" checked="checked"/> Masculino</label>
<?
}
else
{
?>
<label><input name="radiobutton" type="radio" value="RbFeme" checked="checked" />Femenino</label>
<label><input name="radiobutton" type="radio" value="RbMascu"/> Masculino</label>
<?
}
?> </td>
</tr>
<tr>
<td>Fecha de Nacimiento </td>
<td width="261"><label>
<select name="SlcDia" id="SlcDia">
<option value="0" selected="selected">Dia</option>
<?php
for($Dia = 1; $Dia<= 31; $Dia++)
{
if($Dia == $TxtDia)
{
?>
<option value="<?php echo $Dia; ?>" selected="selected"><?php echo $Dia; ?></option>
<?php
}else
{
?>
<option value="<?php echo $Dia; ?>"><?php echo $Dia; ?></option>
<?php
}
}

?>
</select>
-
<select name="SlcMes" id="SlcMes">
<?php
$months = array('Mes', 'Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre');
for($mes = 0;$mes<=12; $mes++)
{
if($mes == $TxtMes)
{
?>
<option value="<?php echo $mes; ?>" selected="selected" > <?php echo $months[$mes]; ?></option>
<?php
}
else
{
?>
<option value="<?php echo $mes; ?>"> <?php echo $months[$mes]; ?></option>
<?php
}
}

?>
</select>
-
<select name="SlcAno" id="SlcAno">
<option value="0" selected="selected"> año </option>
<?php for($ano = (date("Y")); $ano >= 1920; $ano--)
{
if($ano == $TxtAno)
{
?>
<option value="<?php echo $ano; ?>" selected="selected"> <?php echo $ano; ?></option>
<?php
}
else
{
?>
<option value="<?php echo $ano; ?>"> <?php echo $ano; ?></option>
<?php
}

}
?>
</select>
</label></td>
<td width="340">&nbsp;</td>
</tr>
<tr>
<td>Nacionalidad</td>
<td><input type="text" name="TxtNacio" onKeyUp="verificar(this)" onblur="javascript:this.value=this.value.toUpperCa se();" value="<? echo $TxtNacionalidad; ?>" /></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Direcci&oacute;n</td>
<td colspan="2"><label>
<input name="TxtDirec" type="text" size="50" onblur="javascript:this.value=this.value.toUpperCa se();" value="<? echo $TxtDireccion; ?>" />
</label></td>
</tr>
<tr>
<td>Comuna</td>
<td ><input name="TxtComuna" type="text" size="30" id="TxtComuna" onblur="javascript:this.value=this.value.toUpperCa se();" value="<? echo $TxtComuna; ?>" /></td>
<td >&nbsp;</td>
</tr>
<tr>
<td>Cuidad</td>
<td ><input name="TxtCuidad" type="text" id="TxtCuidad" onblur="javascript:this.value=this.value.toUpperCa se();" value="<? echo $TxtCiudad; ?>" /></td>
<td >&nbsp;</td>
</tr>
<tr>
<td>Telefono fijo </td>
<td ><label>
<input type="text" name="TxtFfijo"onKeyPress="return acceptNum(event)" value="<? echo $TxtFonoFijo; ?>" />
</label></td>
<td >Ej: 8153232 </td>
</tr>
<tr>
<td>Telefono Movil </td>
<td ><label>
<input type="text" name="TxtFmovil" onKeyPress="return acceptNum(event)" value="<? echo $TxtFonoMovil; ?>"/>
</label></td>
<td >Ej: 090373130</td>
</tr>
<tr>
<td>Correo Electronico </td>
<td colspan="2" ><input name="TxtMail" type="text" size="35" onSubmit="return emailCheck()" onblur="return emailCheck()" onkeyup="javascript:this.value=this.value.toLowerC ase();" value="<? echo $TxtEmail; ?>" />
Ej: [email protected] </td>
</tr>
<tr>
<td>&nbsp;</td>
<td >&nbsp;</td>
<td >&nbsp;</td>
</tr>
<tr>
<td colspan="3"><label>
<input type="hidden" name="action" value="1"/>
<center><INPUT name="button" TYPE="button" class="clAmenu0" onClick="return Enviar(this.form)" VALUE="Guardar Cambios"/>
</center>
</label></td>
</tr>
</table>
<?
}

}
?>

</form>
__________________
:-D "Que se libere del cielo confinado; que mi cuerpo sea la espada de hielo negro que nos lleve al abismo; que ningún poder pueda detenernos...Destructora de las almas de los dioses!!!":adios:


:pirata:
  #4 (permalink)  
Antiguo 13/02/2007, 15:05
 
Fecha de Ingreso: febrero-2007
Mensajes: 8
Antigüedad: 17 años, 2 meses
Puntos: 0
Re: Pasar datos a textbox

Ok muxas gracias.
  #5 (permalink)  
Antiguo 13/02/2007, 15:11
Avatar de FNX_NET  
Fecha de Ingreso: marzo-2004
Ubicación: EN EL INFIERNO.....
Mensajes: 1.707
Antigüedad: 20 años
Puntos: 7
Re: Pasar datos a textbox

de nada wn, pero di si et funko o no y cual fue tu problema xD
__________________
:-D "Que se libere del cielo confinado; que mi cuerpo sea la espada de hielo negro que nos lleve al abismo; que ningún poder pueda detenernos...Destructora de las almas de los dioses!!!":adios:


:pirata:
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:15.