hai

i have two combo boxes in one php page. i have some items in first combo box they are populated from DB. i want to load items from DB dependent on item selected from first box.

now i met one problem, i use javascript coding for this function. if i select the item from first combo box, the items loaded dynamically in second one, but first combo selected item refreshes and show first item in list(not selected item for me). how can i avoid it. is here use any ajax function?

this is i used js function

<script language="javascript" type="text/javascript">
function changeproject(empid)
{
	location.href="searchtask.php?emp_id="+empid;
}
</script>

first combo box..

<select name="empname"  id="empname" onchange="changeproject(this.value)" >
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.