vendredi 20 mars 2015

How does form buttons can select checkboxes in the next page?

I have some buttons in a first_page.php, and some checkboxes in a second_page.php.

I need to select the corresponding checkbox with a query string to get this:

When "first value button" is pressed --> "second_page.php" with "my first value" checkbox already selected.


first_page.php :



<form action="second_page.php">
<input class="btn" type="submit" value="first value button">
<input class="btn" type="submit" value="second value button">
<input class="btn" type="submit" value="third value button">
</form>


second_page.php :



<form name="name" method="post" action="#">
<input type="checkbox" name="mybox[]" value="my first value"/>
<span>my first box</span><br />
<input type="checkbox" name="mybox[]" value="my second value"/>
<span>my second box</span><br />
<input type="checkbox" name="mybox[]" value="my third value"/>
<span>my third box</span><br />
</form>

Aucun commentaire:

Enregistrer un commentaire