I have this fiddle, it shows a listbox with multiple select, and if you click read, it takes the selected values and puts them into <p>
tag.
Two questions:
1) How do you modify the fiddle that I have created, so when you have finished selecting the items in the listbox it automatically puts them into the <p>
tag? I'm guessing you go down the "on change" route.
2) How do you modify the fiddle that I have created, so it puts the array of selected values into a hidden input which is then submitted back to a MVC3 controller? Is this achievable doing it this way?
UPDATE: Taking on what you guys put as answers, I thought I'd share what I managed to achieve and accomplish with your answers, the example shown in this fiddle
- Single select listbox
- Dynamically changing the contents of the second listbox depending on the selected item of the first listbox
- Showing what items are selected from the second box with the selected value from the first listbox at the end, and this is all put in the hidden input
Thanks guys for taking the time to help me :)