I there, I’m a newbie on CI and I’m having a problem:
On my view page nammed init.php, I have two select boxes on a form and I want to update one select (modelo) with data from database after change selection on other select (fabricante). Does anyone tell me the better way to do this?
Thanks a lot!
There’s the Code:
<form name="detailsearch" action="#" method="get">
<input name="search_statement" type="text" /><br >
<div id="label">Fabricante: </div>
<select name="fabricante">
<option value="0">Indiferente</option>
<?php
$i=0;
foreach($fabricantes->result() as $row) {
echo "<option value=\"".++$i."\">".$row->NOME."</option>\n";
}
?>
</select>
<div id="label">Modelo: </div>
<select name="modelo">
<option value="0">Indiferente</option>
</select>
</form>