Welcome Guest, Not a member yet? Register   Sign In
Update a Select with onchange of other Select
#1

[eluser]Nuno Simões[/eluser]
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:

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>
            &lt;?php
        $i=0;
                foreach($fabricantes->result() as $row) {
            echo "<option value=\"".++$i."\">".$row->NOME."</option>\n";
        }    
            ?&gt;
        </select><br />
        <div id="label">Modelo: </div>
        <select name="modelo">
            <option value="0">Indiferente</option>
        </select><br />
&lt;/form&gt;


Messages In This Thread
Update a Select with onchange of other Select - by El Forum - 11-19-2008, 06:57 PM
Update a Select with onchange of other Select - by El Forum - 11-20-2008, 01:29 AM
Update a Select with onchange of other Select - by El Forum - 11-20-2008, 03:27 AM
Update a Select with onchange of other Select - by El Forum - 11-20-2008, 04:34 AM
Update a Select with onchange of other Select - by El Forum - 11-20-2008, 07:58 AM
Update a Select with onchange of other Select - by El Forum - 11-20-2008, 08:10 AM
Update a Select with onchange of other Select - by El Forum - 11-20-2008, 11:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB