Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/05/2011, 10:04
matiasgreisert
 
Fecha de Ingreso: mayo-2011
Mensajes: 23
Antigüedad: 13 años
Puntos: 0
Relacionar boton con creacion de div

Hola, mi problema es que tengo que crear tantos div como sean cargado datos en los imput. En mi ejemplo solo dibuja un div y cuando modifico los datos, borra el anterior y crea uno nuevo. Si alguien me da algun dato para poder realizar el programa se lo agradeceré. Saludos.


<form name="form1" method="POST">
Top
<input type="text" name="top" value="<?php if(isset($_POST['top'])) echo $_POST['top']; ?>" />
<br />
Left
<input type="text" name="left" value="<?php if(isset($_POST['left'])) echo $_POST['left']; ?>" />
<br />
Width
<input type="text" name="width" value="<?php if(isset($_POST['width'])) echo $_POST['width']; ?>" />
<br />
Height
<input type="text" name="height" value="<?php if(isset($_POST['height'])) echo $_POST['height']; ?>" />
<br />
<input type="submit"/>
</form>
<br /><br />
<?php
if(isset($_POST["top"]) && isset($_POST["left"]) && isset($_POST["width"]) && isset($_POST["height"]))
{
$top=($_POST["top"]);
$left=($_POST["left"]);
$width=($_POST["width"]);
$height=($_POST["height"]);
if(!is_numeric($top)) die ('Top no es numerico <br />');
if(!is_numeric($left)) die ('Left no es numerico <br />');
if(!is_numeric($width)) die ('Width no es numerico <br />');
if(!is_numeric($height)) die ('Height no es numerico <br />');
echo "<div style = 'top:".$top."px; left:".$left."px; height:".$height."px; width:".$width."px; background-color:blue; position:relative;'>";
echo "</div>";
}
?>