Click here to Skip to main content
15,949,741 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi.

I have quite a problem with a form that contains an autocomplete function. The page is an aspx page with c# codebehind.

On the form there is an address field that the user can type in any string address. This field is using an Ajax autocomplete extender, which suggests roadnames to the user. This works fine.
Furthermore the user has the option to add multiple address fields when clicking a button. This works fine now with Jquery. Jquery copies the table which contains, besides other fields, the address field, and "paste" it underneath the existing adress field.

Problem is, how do I attach the Ajax autocomplete extender to the address fields that gets added? Or is there another workaround to make all these fields have this autocomplete function?

Here is my simplfied code:

aspx page:
XML
<td width="200">
  <asp:textbox id="TextBoxStopRoadName" runat="server" width="200" xmlns:asp="#unknown"></asp:textbox>
    </td>
      <asp:autocompleteextender runat="server" xmlns:asp="#unknown">
        TargetControlID="TextBoxStopRoadName"
        ServicePath="SimaWebWebService.asmx"
        ServiceMethod="GetAddressList"
        MinimumPrefixLength="2"
        EnableCaching="false"
        CompletionInterval="10"
        CompletionSetCount="6" />
</asp:autocompleteextender>



Jquery code that copies the address field:

C#
$("#SingleStop").clone().hide().appendTo("#AllStops").slideDown(200);



Really hope you can help!

Thanks alot in advance :)
Posted
Updated 24-Aug-10 2:05am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900