Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set value result and value input #135

Open
maatheeus opened this issue Nov 1, 2021 · 2 comments
Open

Set value result and value input #135

maatheeus opened this issue Nov 1, 2021 · 2 comments

Comments

@maatheeus
Copy link

maatheeus commented Nov 1, 2021

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

@didiosn
Copy link

didiosn commented Nov 28, 2021

you found a way ?

@maatheeus
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants