0
votes

When using JQuery UI Autocomplete, how can I modify the term user entered in the input field, prior to sending the AJAX request?

Eg. user entered foo and the backend gets foo :today?

I've tried to play with search() method but with no luck.

Alternatively, how can I add more query parameters to the src upon sending AJAX, once the src is already set. eg. src = src + '?when=today'`

I'm trying to provide results based on the values of two fields (search term with param selected from other dropdown)

1
Looks like the callback will do fine :)Sfisioza

1 Answers

0
votes

I assume that you are using https://github.com/devbridge/jQuery-Autocomplete

it has a callback, which is invoked before the ajax request:

onSearchStart: function (query) {}

You can modify the query string/object in place.