I have a dynamic list creation script that I inherited that acts a little funny in IE7. The script is:
ad I call it like:
where the form is
Now, what is happening is that with IE7 you cannot use your mouse to select anything from the drop down menus, bt you can select the select box and then use the arrow keys to select what you want to choose. So, any body have any thoughts on what the issue may be?
Thanks,
Willie
Code:
function fillCategory(){
// this function is used to fill the category list on load
addOption(document.drop_list.Category, "High School", "High School", "");
addOption(document.drop_list.Category, "Middle School", "Middle School", "");
addOption(document.drop_list.Category, "Combined", "Combined", "");
}
function SelectSubCat(){
// ON selection of category this function will work
removeAllOptions(document.drop_list.SubCat);
addOption(document.drop_list.SubCat, "", "--Trip--", "");
if(document.drop_list.Category.value == 'High School'){
addOption(document.drop_list.SubCat,"Belize", "Belize");
addOption(document.drop_list.SubCat,"Camp Joy", "Camp Joy");
addOption(document.drop_list.SubCat,"Cranks Creek", "Cranks Creek");
addOption(document.drop_list.SubCat,"Jamaica", "Jamaica");
addOption(document.drop_list.SubCat,"New Orleans 1", "New Orleans 1");
addOption(document.drop_list.SubCat,"New Orleans 4", "New Orleans 4");
addOption(document.drop_list.SubCat,"Tex Mex 1", "Tex Mex 1");
addOption(document.drop_list.SubCat,"Tex Mex 2", "Tex Mex 2");
addOption(document.drop_list.SubCat,"Yucatan, Mexico", "Yucatan, Mexico");
}
if(document.drop_list.Category.value == 'Middle School'){
addOption(document.drop_list.SubCat,"Chattanooga, TN (MS)", "Chattanooga, TN (MS)");
addOption(document.drop_list.SubCat,"Dungannon, VA", "Dungannon, VA");
addOption(document.drop_list.SubCat,"Tex Mex (MS)", "Tex Mex (MS)", "");
addOption(document.drop_list.SubCat,"West Virginia (MS)", "West Virginia (MS)");
}
if(document.drop_list.Category.value == 'Combined'){
addOption(document.drop_list.SubCat,"Chattanooga, TN", "Chattanooga, TN");
addOption(document.drop_list.SubCat,"Jackonsville, FL", "Jackonsville, FL");
addOption(document.drop_list.SubCat,"New Orleans 2", "New Orleans 2");
addOption(document.drop_list.SubCat,"New Orleans 3", "New Orleans 3");
addOption(document.drop_list.SubCat,"West Va 1 (Panther)", "West Va 1 (Panther)");
addOption(document.drop_list.SubCat,"West Va 2 (Welch)", "West Va 2 (Welch)");
}
}
//////////////////
function removeAllOptions(selectbox)
{
var i;
for(i=selectbox.options.length-1;i>=0;i--)
{
//selectbox.options.remove(i);
selectbox.remove(i);
}
}
function addOption(selectbox, value, text )
{
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;
selectbox.options.add(optn);
}
ad I call it like:
Code:
<tr>
<td colspan="2" class="style3"><div align="right">Age Group:</div></td>
<td class="style3"><div align="left">
<select name="Category" id="Category" class="dropdown" onChange="SelectSubCat();">
<option value="">--Age Group--</option>
</select>
</div>
</td>
</tr>
<tr>
<td colspan="2" class="style3"><div align="right">Trip Attending:</div></td>
<td class="style3"><div align="left">
<SELECT id="SubCat" NAME="SubCat">
<Option value="">--Trip--</Option>
</SELECT>
</div>
</td>
</tr>
where the form is
Code:
<form action="sonservants.asp" name="drop_list" method="post" onKeyUp="highlight(event)" onClick="highlight(event)" onSubmit="return isFormComplete(this);">
Now, what is happening is that with IE7 you cannot use your mouse to select anything from the drop down menus, bt you can select the select box and then use the arrow keys to select what you want to choose. So, any body have any thoughts on what the issue may be?
Thanks,
Willie