I have this bit of javascript
:
Code:
selectBox = document.getElementById("IndexDropdown");
badVar = "ORAL";
for (i=0; i<selectBox.options.length; i++) {
if (selectBox.options[i].text.search(badVar) != -1) {
selectBox.options[i] = null;
}
}
affecting this element:
Code:
<select onchange="SetPlayerPosition(this.options[this.selectedIndex].value,this)" style="width:100%" id="IndexDropdown">
<option value="0:4595">16. Oral Report on State and Local Redistricting Proposals.</option>
<option value="0:5546">17. Consideration of the Monthly Financial Report for the Period Ending February 28, 2011 (Staff Presentation.)</option>
<option value="0:10727">ORAL REPORTS BY MEMBERS OF CITY COUNCIL</option>
<option value="0:10729">ORAL PRESENTATIONS BY MEMBERS OF CITY COUNCIL</option>
<option value="0:11427">ORAL REPORT FROM THE CITY MANAGER</option>
<option value="0:15058">26. Consideration of City Council Schedule.</option>
</select>
The code works to remove all options that include "ORAL" (case-sensitive) except for the last option that includes that string. I want it to remove ALL references. What am I doing wrong? When I run it twice it works, but that's not right.