se pierden datos al mostrar en el formulario
Publicado por bydol (1 intervención) el 30/12/2006 11:47:36
Hola,
mi problema es que al rellenar un simple formulario de un campo y escribo x ejemplo ab cd ef separado x espacios al mostrar el resultado con el input solo sale ab, sin embargo en textarea si aparece todo ab cd ef.
Podeis probar aquí mi script : www.bydol.com/empleo/provaform.php
probad introducir: ab cd ef resultado solo sale ab
sin embargo en textarea si aparece todo ab cd ef
-- provaform.php --
<html>
<head>
<title>prueba</title>
</head>
<body>
<?php
$dni=$_POST['dni'];
echo "dni: ".$dni."<hr>";
if ($enviar)
{
?>
<FORM METHOD="post" ACTION="">
<table width="450px" cellpadding="10px"; cellspacing="0" border="0" bgcolor="#abcdef" align="center">
<tr>
<td>resultado</td>
<td><?php echo"<input name=\"dni\" type=\"text\" size=\"9\" maxlength=\"9\" value=$dni>"?></td>
</tr><tr>
<td></td>
</tr>
</table>
</form>
<?php
}
else
{
?> <FORM METHOD="post" ACTION="provaform.php">
<table width="450px" cellpadding="10px"; cellspacing="0" border="0" bgcolor="#abcdef" align="center">
<tr>
<td>introduce <b> ab cd ef </b></td>
<td><?php echo"<input name=\"dni\" type=\"text\" size=\"9\" maxlength=\"9\">"?></td>
</tr><tr>
<td></td>
<td></td><td><input type="submit" name="enviar" value="Enviar"></td>
</tr>
</table>
</form><?php
}
?>
</body>
</html>
Gracias y un saludo.
mi problema es que al rellenar un simple formulario de un campo y escribo x ejemplo ab cd ef separado x espacios al mostrar el resultado con el input solo sale ab, sin embargo en textarea si aparece todo ab cd ef.
Podeis probar aquí mi script : www.bydol.com/empleo/provaform.php
probad introducir: ab cd ef resultado solo sale ab
sin embargo en textarea si aparece todo ab cd ef
-- provaform.php --
<html>
<head>
<title>prueba</title>
</head>
<body>
<?php
$dni=$_POST['dni'];
echo "dni: ".$dni."<hr>";
if ($enviar)
{
?>
<FORM METHOD="post" ACTION="">
<table width="450px" cellpadding="10px"; cellspacing="0" border="0" bgcolor="#abcdef" align="center">
<tr>
<td>resultado</td>
<td><?php echo"<input name=\"dni\" type=\"text\" size=\"9\" maxlength=\"9\" value=$dni>"?></td>
</tr><tr>
<td></td>
</tr>
</table>
</form>
<?php
}
else
{
?> <FORM METHOD="post" ACTION="provaform.php">
<table width="450px" cellpadding="10px"; cellspacing="0" border="0" bgcolor="#abcdef" align="center">
<tr>
<td>introduce <b> ab cd ef </b></td>
<td><?php echo"<input name=\"dni\" type=\"text\" size=\"9\" maxlength=\"9\">"?></td>
</tr><tr>
<td></td>
<td></td><td><input type="submit" name="enviar" value="Enviar"></td>
</tr>
</table>
</form><?php
}
?>
</body>
</html>
Gracias y un saludo.
Valora esta pregunta


0