I'm developing a real estate site with a search, where one of the filters is the neighborhood. Currently it's a dropbox, but I'd like to switch to a checkbox group so I can select more than 1 neighborhood at a time, how can I do that?
I thought of some way to send the information something like this: (& neighborhoods = centro, tatuape)
The search is done with $ _GET.
Form:
<form id="buscalancamento" name="nomebuscalancamento" method="get" action="/incorporadora/terrenos">
<select type="text" name="bairro">
<option>Todos</option>
<option>Centro</option>
<option>Tatuape</option>
</select>
<button type="submit"">Buscar</button>
</form>
And the query:
$bairro = $_GET['bairro'];
//FILTRO BAIRRO
if (isset($bairro)) {
if($bairro=='Todos'){
$wbairro='';
}else{
$wbairro=' AND bairro LIKE "'.$bairro.'" ';
}
}else{$wbairro='';}
$query=("SELECT *, FROM #__ter_terrenos WHERE id > 0".$wbairro);
$db -> setQuery($query);
I do not know how to send all the chebkox with the values together, nor do the query with this data sent