Currently, after typing things the server returns me something like :
[{"id":"1", "value":"My first character"},{"id":"2", "value":"My second Character"}]
And when i’m selecting “My first character”, and sumbiting the form, it sends :
array(1) { ["members"]=> string(18) "My first character" }
But i’d rather send the ID. How to tell .autocomplete to send the id instead of the field’s label ?
( JS code )
It must be simple but i’m missing it.
Thanks
Actually if it’s a text input you are using you will always submit the displayed value. What you could do is copy the id to an hidden element an then catch that server side. You could do: