'jquery autocomplete function dynamic source
I am using jquery-ui with SharePoint and I would like to pass 3 variables from the html to jquery to dynamically build the autocomplete array. Right now I am doing an ajax call to a list and returning the title field. I have to hardcode the list name and the field name. It then pushes the results to an array that is also hard coded. In order to reduce the redundancy of the same code, hardcoded for the 10 fields that use autocomplete, I am hoping to pass it the list name, field name, and array for the field to use.
I was thinking to use something like data-list="list name" data-field="field name" data-array="array name".
Is this a workable way or is there is better way?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
