I am looking to do this :
I have two field
1. Date – using jquery datepicker
2. DropDown – Populated with student id
So , when i select a date say 03/09/2012 i should get all student id present on that day (say 15 of them) , then when i change the date to 04/09/2012 i should get id of only student that are present on that day ( say 29 of them)
I have done is , i have made ajax call to query the database like :
$('#date_selected').blur(function(){
$.ajax({
//query database and get the array of student id present on that date
//but from jquery how do i know populate my dropdown ?
//i would probably get the results json encoded
});
});
No issues about getting the data, i just want to know how to populate the dropdown using the array(json) that i have
Use this inside your ajax success function: