I want to be able to send all the selected values from a listbox as a hidden field using JQuery.
I was able to send/retrieve a single value on form submission.
If anyone can share some code snippet, that would help.
Thanks in Advance!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well, it’s not so clear what you are really asking for. There is no “multiple selection dropdownlist” in HTML. To have a multiselect you need to specify
that will create a
listboxwhere you may select multiple elements. Callingwill return an
Arrayof selected items.edit
To get the text from each option, use
.map()orjQuery.map(). Example:That will create an Array containing the text of all selected entrys.