11.09.2018 Views

Aprender a desarrollar un sitio Web con PHP y MySQL

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

24/4/2014 ENI Training - Libro online<br />

<br />

f<strong>un</strong>ction enviar_formulario() {<br />

document.formulario.action="recibe_post.php";<br />

document.formulario.submit();<br />

}<br />

<br />

<br />

<br />

<br />

Formulario de envío de radio-buttons<br />

eleccion del pais: Francia<br />

España<br />

Rusia<br />

Alemania<br />

<br />

<br />

<br />

<br />

En este caso, es <strong>un</strong> botón normal de tipo button, el que ejecuta la f<strong>un</strong>ción Java-<br />

Scriptenviar_formulario(). Esta f<strong>un</strong>ción define la acción y presenta el formulario. Esto es muy<br />

útil para validar campos antes de enviar el formulario.<br />

El código de la página completa recibe_post.php permite saber si se ha hecho clic en <strong>un</strong> botón de tipo<br />

submit:<br />

<br />

<br />

<br />

Ejemplo <strong>con</strong> POST<br />

<br />

<br />

<br />

<br />

<br />

<br />

Da como resultado:<br />

Procede de <strong>un</strong>a página <strong>con</strong> <strong>un</strong> código javascript<br />

j. El botón reset<br />

Este botón se escribe en HTML de la siguiente manera:<br />

<br />

http://www.eni-training.com/client_net/mediabook.aspx?idR=87322 14/17<br />

www.FreeLibros.me

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!