tawanda
08-02-2005, 02:38 PM
:thumbdn:
I had issues earlier with dynamic drop down lists, and they are now fixed for IE, however when I run the page in firefox, the second of the two lists (whose value is determined in javascript) always displays undefined instead of thier value. It works on IE??? any ideas??
the code looks something like....
<script language = "javascript">
var arrClasses, arrALH, arrCOM, arrECO, arrPSY,
arrALH = ["1111014", "2263041", "2451041"]
arrCOM = ["1053041", "1211041"]
arrECO = ["1013041"]
arrPSY = ["1013041", "1032041"]
arrClasses = [arrALH, arrCOM, arrECO, arrPSY]
function handleChange(newDisplay)
{
var deptSelect, numSelect, numEntries, i
deptSelect = document.shortForm.primary
numSelect = document.shortForm.secondary
for(i = numSelect.length; i >0; i--)
{
numSelect.options[i-1] = null
}
numSelect.options[0] = new Option ("--Select--", 0)
if(newDisplay>=0)
{
numEntries = arrClasses[newDisplay].length
for(i =1; i<= numEntries; i++)
{
numSelect.options[i] = new Option((arrClasses[newDisplay]) [i-1], (arrClasses[i-1[i]]))
}
}
numSelect.selectedIndex = 0
}
</script>
and the html...
<form action="sendmail.asp" method="post" name="shortForm">
<select name="primary" onChange="handleChange(this[this.selectedIndex].value)">
<option value = "-1" selected>--Select--</option>
<option value = "0">ALH</option>
<option value = "1">COM</option>
<option value = "2">ECO</option>
<option value = "3">EDU</option>
<option value = "4">ENG</option>
<option value = "5">HIS</option>
<option value = "6">MAT</option>
<option value = "7">NUR</option>
<option value = "8">PSY</option>
<option value = "9">SPE</option>
<option value = "10">CTD</option>
</select>
</td>
<td colspan="2"><select name="secondary">
<option value ="-1"> -- Select --</option>
<option></option>
<option></option>
</select></td>
</form>
Any help appriciated
Thanks!
I had issues earlier with dynamic drop down lists, and they are now fixed for IE, however when I run the page in firefox, the second of the two lists (whose value is determined in javascript) always displays undefined instead of thier value. It works on IE??? any ideas??
the code looks something like....
<script language = "javascript">
var arrClasses, arrALH, arrCOM, arrECO, arrPSY,
arrALH = ["1111014", "2263041", "2451041"]
arrCOM = ["1053041", "1211041"]
arrECO = ["1013041"]
arrPSY = ["1013041", "1032041"]
arrClasses = [arrALH, arrCOM, arrECO, arrPSY]
function handleChange(newDisplay)
{
var deptSelect, numSelect, numEntries, i
deptSelect = document.shortForm.primary
numSelect = document.shortForm.secondary
for(i = numSelect.length; i >0; i--)
{
numSelect.options[i-1] = null
}
numSelect.options[0] = new Option ("--Select--", 0)
if(newDisplay>=0)
{
numEntries = arrClasses[newDisplay].length
for(i =1; i<= numEntries; i++)
{
numSelect.options[i] = new Option((arrClasses[newDisplay]) [i-1], (arrClasses[i-1[i]]))
}
}
numSelect.selectedIndex = 0
}
</script>
and the html...
<form action="sendmail.asp" method="post" name="shortForm">
<select name="primary" onChange="handleChange(this[this.selectedIndex].value)">
<option value = "-1" selected>--Select--</option>
<option value = "0">ALH</option>
<option value = "1">COM</option>
<option value = "2">ECO</option>
<option value = "3">EDU</option>
<option value = "4">ENG</option>
<option value = "5">HIS</option>
<option value = "6">MAT</option>
<option value = "7">NUR</option>
<option value = "8">PSY</option>
<option value = "9">SPE</option>
<option value = "10">CTD</option>
</select>
</td>
<td colspan="2"><select name="secondary">
<option value ="-1"> -- Select --</option>
<option></option>
<option></option>
</select></td>
</form>
Any help appriciated
Thanks!