Page 1 of 1

geting data in combo box from database

Posted: Fri Dec 18, 2009 6:09 am
by myasirm
hi guys
i have a table with employee name and department name like(hardware,software,networking) now i retrieve department names from data base in first combo box now i want that when i choose hardware it displays the names of employees which are in hardware dept like this

kindly help me in this regards how can i do this
waiting for ur replies

Re: geting data in combo box from database

Posted: Fri Dec 18, 2009 7:49 am
by godwinsam
Hello,

Please implement the onchange() function in select box ie
<select name="example" onchange="">
<option value="Hardware">Hardware</option>
<option value="Hardware">Software</option>
</select>

then pass the value from the combobox to sql query using the ajax or javascript to fetch the corresponding dept employee details..

Regarding the ajax and passing values please find the following link..
http://www.tizag.com/ajaxTutorial/ajax- ... tabase.php

Regards,