I have a javascript which allows me to select items from one (select) menu and add them to another (which is later added to my database). The problem is I have to select the items one at a time. How can I modify this function (below) to allow me to add multiple selections at a time? The drop down allows me to do so, but only the first selection gets added. (The CountMovies() function has nothing to do with it.)
Code:
<script language='javascript'>
function AddMovie()
{
add_movie:
with (document.pickmovies)
{
if (movies.selectedIndex != -1)
{
for (i=0; i<playlist.length; i++)
if (playlist.options[i].value == movies.options[movies.selectedIndex].value)
{
alert('This movie already exists in your playlist.');
break add_movie;
}
playlist.length++;
playlist.options[playlist.length-1].text = movies.options[movies.selectedIndex].text;
playlist.options[playlist.length-1].value = movies.options[movies.selectedIndex].value;
}
CountMovies();
}
}