0

I've been experimenting with a few plugins - some that replace jQuery autocomplete and some that sit alongside it. However, i've found none suitable so far.

I have a complex form with quite a few fields - some of the fields have predicatable inputs e.g. UK county names. I don't wan't to use a dropdown because it gets unwieldly with 90 - 100 entries, so autocomplete would be good - and it looks like i'm going to have to use jQuery's version.

My page (form) is broken down into usercontrols - 1 for each input, with a base template for each type (e.g. input, select, date, period, integer etc.).

I want to be able to define the options for each autocomplete input within the usercontrol itself - this would be populated from a local array.

So, I just need to poplate the autocomplete plugin directly from the usercontrol - again I've looked at a numbe of options including json, webmethods etc., but it seems overcomplicated for what I need. Is there any simpler solution that can be thought of?

John Ohara
  • 2,821
  • 3
  • 28
  • 54
  • 1
    https://jqueryui.com/autocomplete/ Look at the source code, does it really look over complicated ? – TCHdvlp Jul 20 '16 at 11:33
  • look at the `source` option http://api.jqueryui.com/autocomplete/#option-source – TCHdvlp Jul 20 '16 at 11:34
  • @TCHdvlp - no it doesn't - It would be easy to just add tags straight into the javascript like the example shows but I don't want to have to maintain that within the javascript. – John Ohara Jul 20 '16 at 11:38
  • I'm not sure to clearly understand. You want to add or remove items dynamiccaly in the autocomplete ? That's not a problem. The source can be a variable or a function. You can make an ajax call that will get the list from the server and then apply it to the source. http://stackoverflow.com/questions/21385892/how-to-use-source-function-and-ajax-in-jquery-ui-autocomplete – TCHdvlp Jul 20 '16 at 12:25

0 Answers0