samedi 20 juin 2015

PHP check if some of multiple checkboks are checked

I have a list of services the user have to select in a form. Left side filter from a results page. current page listings.php

<form method=get action=listings.php>
<input type=checkbox name=serv[] value='Service 1' onclick="this.form.submit()" />
<input type=checkbox name=serv[] value='Service 2' onclick="this.form.submit()" />
<input type=checkbox name=serv[] value='Service 3' onclick="this.form.submit()" />
<input type=checkbox name=serv[] value='Service 4' onclick="this.form.submit()" />
<input type=checkbox name=serv[] value='Service 5' onclick="this.form.submit()" />
<input type=checkbox name=serv[] value='Service 6' onclick="this.form.submit()" />
<input type=checkbox name=serv[] value='Service 7' onclick="this.form.submit()" />
</form>

So I need once the page reloads and the form is sent, the selected checkboxes be checked to show the user he selected those services and there are still some others to select.




Aucun commentaire:

Enregistrer un commentaire