Remplir un tableau selon le choix d'un select
Bonjour à tous
J'ai un select qui contient la liste de catégories et sous catégories de différents services proposés.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| <select id='select' name='select' onchange='...'>
<option value=''>-----choisir-----</option>
<?php foreach($this->categories as $item)
{
if($item->id_parent == 0)
{ ?>
<option value="<?php echo $item->id ?>"><?php echo $item->categorie; ?></option>
<?php }
else{ ?>
<option value="<?php echo $item->id ?>"><?php echo '-- '.$item->categorie; ?></option>
<?php }
} ?>
</select> |
Je voudrais que mon tableau qui contient la liste de services avec leurs détails se charge selon la valeur choisie dans select..
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| <table class="listeservices">
<thead>
<tr>
<th width="40">Id</th>
<th width="100">Service</th>
<th width="350">Description</th>
</tr>
</thead>
<tbody>
<?php foreach($this->listeservices as $services){ ?>
<tr id="<?php echo $services->id_categorie; ?> ">
<td><?php echo $services->id; ?></td>
<td><?php echo $services->nom; ?></td>
<td><?php echo $services->description; ?></td>
</tr>
<?php } ?>
</tbody>
</table> |
Quelqu'un pourrait me guider svp?
Merci d'avance