I want to add the selected items in a drop down box and put them in a text box.
I can now select just one item & put it in the text box :
Html code:
<select name="ncontacts" id = "contacts" multiple="yes" onclick="ChooseContact(this)"> </select>
JS code:
function ChooseContact(data)
{
document.getElementById ("friendName").value = data.value;
}
But when I select 2 items just the first one is written in the textbox.
So, do you know how can I fix it, to let both of them appear in the textbox?
One possible (basic) solution is something like this: