Selecting id's, displaying values
See original GitHub issueI’ve just implemented typeahead to serve as a kind of autocomplete select tag, fetching the names, companies and emails of a bunch of users. However upon selecting one of them, it sets the value of the text field to the id of the object in question, while I want to display the name.
In other words, I’d like to mimic something like <option value="1">John Doe</option>
where I would submit the 1 value while never having to display it. And I prefer not having to do an additional query to find a person based on their name (which may not even be unique all the time).
I hope that makes sense. Hannes
Issue Analytics
- State:
- Created 10 years ago
- Reactions:1
- Comments:18 (2 by maintainers)
Top Results From Across the Web
HTML select dropdownlist how to display the VALUE/ID ...
I like how the first select element displays the original value when a different option is selected. Very nice :) – slee423. Jun...
Read more >ID selectors - CSS: Cascading Style Sheets - MDN Web Docs
The CSS ID selector matches an element based on the value of the element's id attribute. In order for the element to be...
Read more >HTML select id Attribute - Dofactory
The id attribute on a select element assigns a unique identifier to that element. ... Clicking the button displays the selected value of...
Read more >Solved: Problem with selecting dropdown values(IDs) from N...
I am storing Y Table ID in X Table. In PowerApps Edit screen I am going to show one drop down for Y...
Read more >How To Select HTML Elements Using ID, Class, and Attribute ...
You will begin by creating an HTML and a CSS file that you will edit throughout the tutorial. You will then add id...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can use the custom events ‘typeahead:selected’ and ‘typeahead:autocompleted’ to populate a hidden input within the form. These custom events contain the datum selected as an argument. You’ll want something like:
$(#TypeAheadInput").on(“typeahead:selected typeahead:autocompleted”, function(e,datum) { $(hiddenInput).val() = datum.id; })
agreed. I’d really like to be able to specify what values are submitted in the typeahead for independent of the values displayed…