geting data in combo box from database

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
myasirm
Forum Commoner
Posts: 54
Joined: Sat Sep 12, 2009 3:57 am

geting data in combo box from database

Post 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
godwinsam
Forum Newbie
Posts: 9
Joined: Wed Sep 16, 2009 11:01 pm

Re: geting data in combo box from database

Post 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,
Post Reply