As title says I need help with onchange. I have select tag,and I need to do different mysql query when I choose something from select list. Example:
<select name="list">
<option>cars</option>
<option>busses</option>
<option>trucks</option>
</select>
and then when i select cars it do this
$query="select * from table where type='cars'";
and if I choose trucks it do
$query="select * from table where type='trucks'";
and so on…
then I need to display the result in div under the list
example
<select name="list">
<option>cars</option>
<option>busses</option>
<option>trucks</option>
</select>
<div> this is where I need to display results from query</div>
Please help!!!
If you want to change the result by ajax :
HTML :
in JS File:
and you should create change_query.php file and your query and code in it and return the result in it
print result here …. ;