Remove options from select box if it is already selected in onother
<p>I have a form. The user clicks the add button to add another state + text box for that state.  When people select a state in the first box, I want it removed from any other select box that may be added so it can not be selected again.</p>

<pre><code>&lt;form action=state.php method=post&gt; 

&lt;a href="javascript:addElement();" style='color:blue; text-decoration:underline;'&gt;Add a State &lt;/a&gt; &amp;nbsp; &amp;nbsp; 
&lt;a href='javascript:removeElement();' style='color:blue; text-decoration:underline;' &gt;Remove &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;

&lt;script type="text/javascript"&gt;
    var intTextBox=0;

    //FUNCTION TO ADD TEXT BOX ELEMENT
    function addElement() {
        intTextBox = intTextBox + 1;
        var contentID = document.getElementById('addresscontent');

        var newTBDiv = document.createElement('div');

        newTBDiv.setAttribute('id','strText'+intTextBox);

        newTBDiv.innerHTML = "&lt;select   id='u" + intTextBox + "' name=b_state[" + intTextBox + "][statename]/&gt;&lt;option value=''&gt;Select a State&lt;/option&gt;&lt;option  value='AK'&gt;AK&lt;/option&gt;&lt;option  value='AL'&gt;AL&lt;/option&gt;&lt;option  value='AR'&gt;AR&lt;/option&gt;&lt;option  value='AS'&gt;AS&lt;/option&gt;&lt;option  value='AZ'&gt;AZ&lt;/option&gt;&lt;option  value='CA'&gt;CA&lt;/option&gt;&lt;/select&gt; &amp;nbsp; &lt;span style='font-size:12px;'&gt;URL (if different) &lt;/span&gt;&lt;input style='border:1px solid black; ' size=60 type='text' id='u" + intTextBox + "' name=b__state[" +intTextBox + "][url] /&gt;&lt;br&gt;";

        contentID.appendChild(newTBDiv);
    }

    //FUNCTION TO REMOVE TEXT BOX ELEMENT
    function removeElement()  {
        if(intTextBox != 0)  {
            var contentID = document.getElementById('addresscontent');
            contentID.removeChild(document.getElementById('strText'+intTextBox));
            intTextBox = intTextBox-1;
        }
    }
&lt;/script&gt;

&lt;div id="addresscontent"&gt;&lt;/div&gt;

&lt;/div&gt;

&lt;input type=submit value='go'&gt;
</code></pre>
