In my mvc 3 project I have a form which contains a list of Addresses to edit. I also have a button to add new addresses.
For dynamic collection edit I used Steven Sandersons technique. http://blog.stevensanderson.com/2010/01/28/editing-a-variable-length-list-aspnet-mvc-2-style/
For autocomplete I am using the JQueryUI autocomplete
My problem is that the id’s for the input elements I want to connect Autocomplete to are created using an HtmlHelper so I am not sure how I should be linking AutoComplete with the input element.
Although some sample code would be welcome I am happy with just an idea to solve this.
Simply use classes instead of ids. Assign the same class to all input fields that you want to have autocomplete and then use a CSS selector: