Javascript to restrict to add the same item more than once to the second listbox
<p>I want to restrict to add the same item more than once to the second listbox, i think i am very close to it . please help</p>

<pre><code>&lt;script type="text/javascript"&gt;
    function CopyFile() {
        var firstListBox = document.getElementById('&lt;%= lstFirstBox.ClientID %&gt;');
        var secondListBox = document.getElementById('&lt;%= lstTarget.ClientID %&gt;');
        for (var i = 0; i &lt; firstListBox.options.length; i++) {
            if (firstListBox.options[i].selected) {
                for (var j = 0; j &lt; secondListBox.options.length; j++) {
                    if (firstListBox.options[i].selected == secondListBox.options[j]) {
                        alert("Multiple selection will not allow");
                    }
                    else {
                        var newOption = document.createElement("option");
                        newOption.text = firstListBox.options[i].text;
                        newOption.value = firstListBox.options[i].value;
                        secondListBox.options[secondListBox.options.length] = newOption;
                        firstListBox.options[i].selected = false;
                    }

                }

            }
        }
        return false;

    }
&lt;/script&gt;
</code></pre>
