Hola! estoy intentando que un formulario se muestre segun un condicional de php.
Lo que me gustaria es que al dar a editar se cambie un formulario por otro... lo que no se si esto es posible... ya que innerHTML tampoco me funcionaba.
bueno lo muestro mejor

a ver si me podeis decir si se puede hacer esto o si hay alguna forma mejor!
1000 grasias!!!
<?php
$var1=($_GET['pagina']);
$var2=($_GET['cliente']);
if(($var1)&($var2)){ //hasta aqui entra pero al hacer click en la imagen hace un hidden momentaneo y vuelve al formulario inicial
?>
<script>
document.getElementById("formulario").style.visibi lity='hidden';
document.getElementById("formulario2").style.visib ility='visible';
</script>
<?
}
$resultado = mysql_query("SELECT id,nombre FROM clientes);
?>
<table>
<tr>
<th>Id</th>
<th>Nombre</th>
</tr>
<?php
while ($fila = mysql_fetch_array($resultado, MYSQL_ASSOC)){
$nfila= $fila['id'];
echo "<tr>";
echo "<td> ".$fila['id']." </td>";
echo "<td> ".$fila['nombre']." </td>";
echo '<td><a href="intranet.php?pagina=boton1&cliente='.$nfila. '"><img src='editar.gif'/></a></td>'; //al hacer click en la imagen refresca la pantalla
echo "</tr>";
}
?>
</table>
<div id="formulario">
<form action="" method="post" >
<label for="nombre">Nombre:</label>
<input type="text" name="nombre" id="textfield" />
</form>
</div>
<div id="formulario2" style="visibility:hidden">
<form action="" method="post">
<label for="nombre">Nombre:</label>
<input type="text" name="nombre" id="textfield" />
<label for="id"></label>
<input type="hidden" name="id" value="aqui php" />
</form>
</div>
Bueno espero que me puedan ayudar!si no he sido muy clara decirmelo que especifico mas.