Comunidad de diseño web y desarrollo en internet online

Formulario sin input type="submit"

Citar            
MensajeEscrito el 09 Mar 2013 11:26 pm
Hola a todos.
Soy muy novatillo en paginas dinámicas, y es posible que el problema que tengo sea una tonteria de facil solución.

Tengo un formulario en un frame, y intento recoger las variables en otro sin tener que usar el boton submit.
Expongo el código:

Index.html:
<frameset cols="20%,*" border=1>
<frame name="Izquierdo" src="Pag1.html">
<frame name="Derecho" src="Pag2.html">
</frameset>

Pag1.html:
<FORM action="Pag2.html" name= "miformulario" id="miformulario" method="POST" onSubmit="miformulario.target ='Derecho';return true;">
<input type="checkbox" name="var" onClick= "forms[0].submit();">Variable<br>
</FORM>

Pag2.html:
<?
$var= $_POST["var"];
echo "$var";
?>

El problema que tengo es que con este codigo Pag2.html no actualiza y se me carga en Pag1.html. Es decir las variables llegan a Pag1.html y yo quiero que llegen a Pag2.html.

Si borro en Pag2.html el onClick, y coloco un <input type="submit" value="Enviar" /> todo va bién como yo quiero, pero yo no quiero un botón para enviar el formulario.
Se agradecería mucho cualquier sugerencia ya que me estoy volviendo majareta.

Saludos a todos.
Sont

Por Sont

16 de clabLevel



 

firefox
Citar            
MensajeEscrito el 10 Mar 2013 12:22 am
Me autocontesto y puede que a alguien le sirva de algo:

<FORM action="Pag2.html" name= "miformulario" id="miformulario" method="POST">
<input type="checkbox" name="var" onClick="forms[0].target= 'Derecha'; miformulario.submit();">Variable<br>

Aún así muchas gracias a todos.
Sont.

Por Sont

16 de clabLevel



 

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.