Comments (5)
The same way you would with any other input. Have in mind that for serializeArray() to work, you need to have set the 'name' attribute of your input.
from bootstrap-4-autocomplete.
Thank you for your answer. But this way only the label will be serialized, not the value
from bootstrap-4-autocomplete.
Well, a label is one thing, a value is another and the id is even another. Anyway, that's how jQuery's serializeArray() works, and this has nothing to do with this lib. If you want another result, you should implement your own serialization.
from bootstrap-4-autocomplete.
Yes, but when using a dropdown we can pass an option label and value and serializeArray() will use the option value of the selected option. With this autocomplete control only the label is accessible.
from bootstrap-4-autocomplete.
You have to implement the onSelectItem callback to get this value. I'd advise to set it to a hidden input on your form, and leave the autocomplete input without a name so it doesn't get serialized.
from bootstrap-4-autocomplete.
Related Issues (20)
- Change the format source? HOT 1
- source from database in json format HOT 1
- Handling values not found in source array
- remote data HOT 1
- Three extra options HOT 2
- It would be helpful to have an index parameter HOT 1
- External file with content HOT 1
- Multi word search HOT 6
- Use with JSON Array? HOT 6
- External source data HOT 2
- Do not show dropdown on 'readonly' fields.
- Typographical Error: `treshold` should be `threshold` HOT 2
- Reposition list when items are shown above input field
- Show autocomplete list at typed order
- How do I refresh the values list without refreshing all the control ?
- Keyboard Arrows Throwing Console Errors When Pressed HOT 4
- List not being hidden after selection HOT 2
- threshold not treshold HOT 3
- Why is value set to label and not to value? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bootstrap-4-autocomplete.