Mark Phillips
06-17-2005, 08:51 PM
Hi,
I am writing an ASP.NET page that uses JavaScript to show, hide and set default values for a set of controls that are held in an array called the newExpenseControls. This code runs when the onchange event of a selectbox fires. The method works with no problem in IE6 and Opera7.02, but is not working in Netscape 7(Gecko). The event does seem to fire in Netscape 7 because the first method within the event is working. clearNewExpenseTextBoxes()
The code is pretty standard stuff. Can anyone help?
function newExpenseTypeChanged()
{
clearNewExpenseTextBoxes();
var expenseTypeID = newExpenseControls[0].options(newExpenseControls[0].selectedIndex).value;
// Set Qty
if (expenseTypeID == 1)// Telephone
{
newExpenseControls[3].style.visibility = "hidden";
setQtyValidators(false)
}
else
{
newExpenseControls[3].style.visibility = "visible";
setQtyValidators(true)
// Other
if (expenseTypeID == 3)
newExpenseControls[3].value = "1"
}
// Set Mileage
if (expenseTypeID == 2)
{
newExpenseControls[4].value = document.getElementById("hidMileageRate").value;
newExpenseControls[4].style.display="none";
setDisabledAmount(true);
}
else
{
setDisabledAmount(false);
newExpenseControls[4].style.display="inline";
}
newExpenseControls[1].focus();
}
I am writing an ASP.NET page that uses JavaScript to show, hide and set default values for a set of controls that are held in an array called the newExpenseControls. This code runs when the onchange event of a selectbox fires. The method works with no problem in IE6 and Opera7.02, but is not working in Netscape 7(Gecko). The event does seem to fire in Netscape 7 because the first method within the event is working. clearNewExpenseTextBoxes()
The code is pretty standard stuff. Can anyone help?
function newExpenseTypeChanged()
{
clearNewExpenseTextBoxes();
var expenseTypeID = newExpenseControls[0].options(newExpenseControls[0].selectedIndex).value;
// Set Qty
if (expenseTypeID == 1)// Telephone
{
newExpenseControls[3].style.visibility = "hidden";
setQtyValidators(false)
}
else
{
newExpenseControls[3].style.visibility = "visible";
setQtyValidators(true)
// Other
if (expenseTypeID == 3)
newExpenseControls[3].value = "1"
}
// Set Mileage
if (expenseTypeID == 2)
{
newExpenseControls[4].value = document.getElementById("hidMileageRate").value;
newExpenseControls[4].style.display="none";
setDisabledAmount(true);
}
else
{
setDisabledAmount(false);
newExpenseControls[4].style.display="inline";
}
newExpenseControls[1].focus();
}