I have tried two versions of code from this forum to clear my drop down of all data, but get an error at the bottom of my browser status bar.
First method:
<script type="text/javascript">
function State_Select()
{
ind = document.payoff_regionsearch.StateList.selectedIndex;
val = document.payoff_regionsearch.StateList.options[ind].value;
var i;
for (i = document.payoff_regionsearch.CountyList.options.length - 1; i >= 1; i--){
document.payoff_regionsearch.CountyList.options = i;
}
//rest of function State_Select
Second method:
<script type="text/javascript">
function clearList()
{ //Clears any existing elements in the selectbox
var len = document.getElementById('CountyList').options.length
for(i = 0; i < len; i++)
document.getElementById('CountyList').options[0] = null;
}
function State_Select()
{
ind = document.payoff_regionsearch.StateList.selectedIndex;
val = document.payoff_regionsearch.StateList.options[ind].value;
//call clearlist function
clearlist();
//rest of function State_Select
Thanks for your help.
I believe the <select> / dropdown is an html element, not activex control, etc.
I'm not sure how to debug either.
First method:
<script type="text/javascript">
function State_Select()
{
ind = document.payoff_regionsearch.StateList.selectedIndex;
val = document.payoff_regionsearch.StateList.options[ind].value;
var i;
for (i = document.payoff_regionsearch.CountyList.options.length - 1; i >= 1; i--){
document.payoff_regionsearch.CountyList.options = i;
}
//rest of function State_Select
Second method:
<script type="text/javascript">
function clearList()
{ //Clears any existing elements in the selectbox
var len = document.getElementById('CountyList').options.length
for(i = 0; i < len; i++)
document.getElementById('CountyList').options[0] = null;
}
function State_Select()
{
ind = document.payoff_regionsearch.StateList.selectedIndex;
val = document.payoff_regionsearch.StateList.options[ind].value;
//call clearlist function
clearlist();
//rest of function State_Select
Thanks for your help.
I believe the <select> / dropdown is an html element, not activex control, etc.
I'm not sure how to debug either.