populate another drop down on selection of first
<p>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.</p>

<p>Jquery code.</p>

<pre><code>$("&lt;select/&gt;", {
class: "selectdoctor",
name: "selectdoctor" + i,
id: "selectdoctor" + i
}).appendTo("#prescriptiondiv").after("&lt;br/&gt;");
</code></pre>

<p>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.</p>

<pre><code>$.post("getdoctorlist.php", {
        childid: childid
    }, function(data) {
    //alert(data);
    $('.selectdoctor').html(data);
    });
</code></pre>

<p>My phpcode for <code>getdoctor.php</code> list has code,</p>

<pre><code>if(mysql_num_rows($query)!=0);
{
    while($result=mysql_fetch_assoc($query))
    {
   echo '&lt;option value="'.$result["pcpkey"].' "&gt;'.$result["pcpfname"].'&lt;/option&gt;';  
   }
}
</code></pre>

<p><strong>How can I fetch this response(data) in <code>drop down with classname='selectdoctor'</code> ?</strong></p>
