Welcome Guest, Not a member yet? Register   Sign In
Auto Fill Dropdown from Database
#2

[eluser]Ahmed Nuaman[/eluser]
Why don't you simply use AJAX?

You can use such code for the parent cat dropdown:

Code:
<? foreach ($cats as $v) { ?>
<option value="&lt;?=$v-Id;?&gt;">&lt;?=$v-Name;?&gt;</option>
&lt;? } ?&gt;

And then using AJAX (such as: http://www.prototypejs.org) you can add the "onchange" attr to the <select> field around the parent categories. That will then run a query, get the sub cats and put them into a second <select> below.


Messages In This Thread
Auto Fill Dropdown from Database - by El Forum - 01-29-2008, 10:02 AM
Auto Fill Dropdown from Database - by El Forum - 01-29-2008, 10:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB