autocomplete icon indicating copy to clipboard operation
autocomplete copied to clipboard

Set value result and value input

Open maatheeus opened this issue 4 years ago • 2 comments

It's possible set value input and other value to label.

{"id":1, "name":"xpto"}

I need submit value id and show value name in search.

In js component

maatheeus avatar Nov 01 '21 19:11 maatheeus

you found a way ?

didiosn avatar Nov 28 '21 07:11 didiosn

Hi, Yes

<div id="autocomplete_exams" class="autocomplete">
        <input class="autocomplete-input" />
        <ul class="autocomplete-result-list"></ul>
        <ul id="no-results" class="autocomplete-result-list" visible="false"></ul>
 </div>
<input type="hidden" name="value_id" id="value_id">

Use hidden input to store the id value. Also use onchange in select to update the hidden input value

maatheeus avatar Dec 29 '21 14:12 maatheeus