Dynamic Drop down with jquery?
<p>I used dynamic drop down with jquery.I am getting data into drop down but when i selected specific item that time it is fetching first record in list.</p>

<p>My coding:
This function is response from ajax.</p>

<pre><code>function updateItem()
{
    var item= xmlhttp.responseXML.getElementsByTagName("ExpenseType");
    var itemId = "0";
    var itemName = "--";
    document.getElementById("reportAhcc_Item_ID_S").length = 0;
    if(item.length != "0")
    {
        for(var i=0;i&lt;item.length;i++)
        {
            itemId=item[i].getElementsByTagName("ItemId")[0].childNodes[0].nodeValue;
            itemName=item[i].getElementsByTagName("ItemName")[0].childNodes[0].nodeValue;
            document.getElementById("reportAhcc_Item_ID_S").options[i]=new    Option(itemName,itemId);
        }
    }
    else
    {
        document.getElementById("reportAhcc_Item_ID_S").options[0]=new Option(itemName,itemId);
    }
}
</code></pre>

<p>Below code to create combobox</p>

<pre><code>$( "#reportAhcc_Item_ID_S" ).combobox()
</code></pre>

<p>for fetching selected item from list i used</p>

<pre><code>var getItem =  $("#reportAhcc_Item_ID_S option:selected").text();
</code></pre>

<p>hear i am facing problem.Always it is fetching first record in list.</p>

<p>Could you help how to fetch my selected item from list.</p>

<p>with regards,
Chandrasekhar</p>
