Autocomplete extender for multiple textbox using Javascript
<p>I want to apply one autocomplete extender for multiple textbox having same <code>name</code> attribute, For eg.</p>

<p>I just want to apply same autocomplete extender to all having <code>name="txtQtyPkgs"</code>. How I can do this?
My html</p>

<pre><code>&lt;table cellspacing="0" cellpadding="0" border="0" style="" id="flex1"&gt;
        &lt;tbody&gt;
            &lt;tr id="rowGH03013"&gt;
                &lt;td align="Left" class="sorted"&gt;
                    &lt;div style="text-align: left; width: 150px;"&gt;
                        GH03013&lt;/div&gt;
                &lt;/td&gt;
                &lt;td align="Left"&gt;
                    &lt;div style="text-align: left; width: 150px;"&gt;
                        999&lt;/div&gt;
                &lt;/td&gt;
                &lt;td align="Left"&gt;
                    &lt;div style="text-align: left; width: 161px;"&gt;
                        &lt;input align="right" type="text" width="30px" name="txtQtyPkgs" maxlength="3" onblur="IntegerOnly(this.id);"
                            id="QtyPkgs19523"&gt;&lt;/div&gt;
                &lt;/td&gt;
                &lt;td align="Left"&gt;
                    &lt;div style="text-align: left; width: 446px;"&gt;
                        &lt;input align="left" type="text" width="300px" class="auto" maxlength="100" name="txtBuyerName"
                            id="Buyer19523"&gt;&lt;/div&gt;
                &lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr class="erow" id="rowGH03011"&gt;
                &lt;td align="Left" class="sorted"&gt;
                    &lt;div style="text-align: left; width: 150px;"&gt;
                        GH03011&lt;/div&gt;
                &lt;/td&gt;
                &lt;td align="Left"&gt;
                    &lt;div style="text-align: left; width: 150px;"&gt;
                        999&lt;/div&gt;
                &lt;/td&gt;
                &lt;td align="Left"&gt;
                    &lt;div style="text-align: left; width: 161px;"&gt;
                        &lt;input align="right" type="text" width="30px" name="txtQtyPkgs" maxlength="3" onblur="IntegerOnly(this.id);"
                            id="QtyPkgs19521"&gt;&lt;/div&gt;
                &lt;/td&gt;
                &lt;td align="Left"&gt;
                    &lt;div style="text-align: left; width: 446px;"&gt;
                        &lt;input align="left" type="text" width="300px" class="auto" maxlength="100" name="txtBuyerName"
                            id="Buyer19521"&gt;&lt;/div&gt;
                &lt;/td&gt;
            &lt;/tr&gt;
        &lt;/tbody&gt;
    &lt;/table&gt;
</code></pre>

<p>my xml data</p>

<pre><code>&lt;table&gt;
  &lt;userid&gt;23&lt;/userid&gt;
  &lt;userdispname&gt;GUJARAT PACKERS LTD&lt;/userdispname&gt;
  &lt;usercode&gt;GTPL&lt;/usercode&gt;
&lt;/table&gt;

&lt;table&gt;
  &lt;userid&gt;26&lt;/userid&gt;
  &lt;userdispname&gt;Lipton India Limited&lt;/userdispname&gt;
  &lt;usercode&gt;Lipton&lt;/usercode&gt;
&lt;/table&gt;
&lt;table&gt;
  &lt;userid&gt;27&lt;/userid&gt;
  &lt;userdispname&gt;TOSH LTD.&lt;/userdispname&gt;
  &lt;usercode&gt;ATosh&lt;/usercode&gt;
&lt;/table&gt;
&lt;table&gt;
  &lt;userid&gt;28&lt;/userid&gt;
  &lt;userdispname&gt;SERVICES INDIA PVT. LTD.&lt;/userdispname&gt;
  &lt;usercode&gt;TSI&lt;/usercode&gt;
&lt;/table&gt;
&lt;table&gt;
  &lt;userid&gt;29&lt;/userid&gt;
  &lt;userdispname&gt;Parekh Company&lt;/userdispname&gt;
  &lt;usercode&gt;Parekh&lt;/usercode&gt;
&lt;/table&gt;
&lt;table&gt;
  &lt;userid&gt;30&lt;/userid&gt;
  &lt;userdispname&gt;SHREE BALAJI CO.&lt;/userdispname&gt;
  &lt;usercode&gt;Balaji&lt;/usercode&gt;
&lt;/table&gt;
&lt;table&gt;
  &lt;userid&gt;31&lt;/userid&gt;
  &lt;userdispname&gt;Kesaria Company&lt;/userdispname&gt;
  &lt;usercode&gt;Kesaria&lt;/usercode&gt;
&lt;/table&gt;
</code></pre>

<p>my javascript</p>

<pre><code>$(document).ready(function () {
            AuctoCmplBuyer();
            $(".auto").autocomplete({ source: [AuctoCmpData] });
        });
 function AuctoCmplBuyer() {
            $.ajax({
                type: "POST",
                url: "../service/WebService.asmx/XmlData",
                data: "{strData:'BuyerList'}",
                contentType: "application/json; charset=UTF-8",
                dataType: "xml",
                success: function (msg) {
                    $(msg).find('Table').each(function () {
                        if (StrData.length != 0) {
                            StrData = StrData + ",";
                        }
                        StrData = '{"id":"' + $(this).find('UserID').text() + '","label":"' + $(this).find('UserDispName').text() + '","value":"' + $(this).find('UserDispName').text() + '"}';
                    });
                }
            });
            AuctoCmpData = StrData;
        }
</code></pre>
