I am going to populate a another drop down on selection of
first drop down. Implementing this with intermediate php file. I am showing second drop
down on basis of Jquery.
Jquery
code.
$("",
{
class: "selectdoctor",
name: "selectdoctor" + i,
id:
"selectdoctor" +
i
}).appendTo("#prescriptiondiv").after("
");
This
dropdown will be shown number of times using for loop. So I can populate value in this
on basis of class only.
Second jquery that will send value to phpfile and
fetch result using ajax has
code.
$.post("getdoctorlist.php",
{
childid: childid
}, function(data) {
//alert(data);
$('.selectdoctor').html(data);
});
My phpcode for
getdoctor.php
list has
code,
if(mysql_num_rows($query)!=0);
{
while($result=mysql_fetch_assoc($query))
{
echo
'';
}
}
How
can I fetch this response(data) in drop down with
?
classname='selectdoctor'
No comments:
Post a Comment