Closed roburcio closed 3 years ago
Wich part of documentation says something about replacing? Anyway, it's hard to help without seeing any code
Thank you for your fast reply I used this template that I found on documentation: [{% for author in results -%} {{ {id: author.id, label: author.name, value: author.name}|json_encode|raw }} {# use "value" instead of "id" key, if you use jquery-ui #} {%- if not loop.last %},{% endif -%} {%- endfor %}]
The problem is that if I replace value on the first parameter it does not work because value on second paarameter overwrite the first. Sorry for my poor english
I guess that value: author.name
should be removed
Yes I did it, but it does not work. I write here my twig template Twig: [{% for elenco in risultati -%}
{{ {value: elenco.id, label: elenco.autore, value: elenco.autore}|json_encode|raw }} {%- if not loop.last %},{% endif -%} {%- endfor%}]
In this case when I begin to write, it shows the ids and not labels. When I choose an id it writes correctly the label in the field...
Sorry I copied a wrong twig the line where I put values is this: {{ {value: elenco.id, label: elenco.autore}|json_encode|raw }}
Thanks!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
This issue is closed because was marked as stale and had no activity. Thank you for your contributions.
Hello, I'm using autocomplete-bundle with symfony 5 in a form. I'm using the bundle with jqueryui because select2 has accessibility issues for screenreaders. All works fine, but I don'to know how can I solve a problem: In documentation you say that I have to replace id with value using jqueryui. It works but when I'm writing in the field text it shows ids instead labels. When I confirm the choice it shows, correctly, the label. I tried also to put another value with label but it overwrite the first value and I do not have ids anymore. Do you Know how can I solve this problem? Thank you in advance