I have a requirement for adding values selected in a select box to a input box with the same form and am not sure how to best go about this. The select box contains user email addresses and the input box needs to contain multiple email addresses. The idea is that when you select a email address from the select box it is then added to the input either automatically, or by clicking the add button which reload the page in PHP adding to a variable that is the value of the input box. I have tried to do this by having a form within a form but that does not work is there a better way of doing this?
Many thanks.
Well, in the select’s onchange event, set the inputs value to all of the selected options concatenated together.
Here’s some psuedo-code:
Again in jQuery:
Edit: Here’s what you wanted, without multi-select.