Ver Mensaje Individual
  #12 (permalink)  
Antiguo 06/10/2011, 07:42
calichinew
 
Fecha de Ingreso: agosto-2009
Ubicación: lima
Mensajes: 63
Antigüedad: 15 años, 7 meses
Puntos: 1
Respuesta: datos pegados cuando actualizo

se borra los datos que ya habia ingresado en index.php cuando doy click en Cancelar>> de insertarpais.php

index.php
...
<form id="form_a" name="form_a" method="post" action="see-data.php">
...
<input name="nombres" type="text" id="nombres" size="35" maxlength="35" value="<?php if (isset($_SESSION['form_a']['nom'])) { echo $_SESSION['form_a']['nom']; } ?>" onKeyUp="validar(this)" />
...
</form>

see-data.php
<?php
$_SESSION['form_a'] = array(
'nom' => $_POST['nombres'],
'campo2' => $_POST['campo2'],
'campo3' => $_POST['campo3'],
);
header ("Location: insertarpais.php");
?>

insertarpais.php
<form name="f1" method="post" action="insertapais.php" onsubmit="return validar()">
...
<input name="boton_volver" type="button" value="Cancelar >>" id="boton_volver" onclick="location.href='index.php'" />
...
</form>

¿el boton deve ser del type "button" o "submit"?

Última edición por calichinew; 06/10/2011 a las 08:00