Hi there,
I have a function (one of many) which is called onclick of a number of different elements of a form. This function works perfectly (with no detected script errors) in Internet Explorer, and I have even downloaded Opera to check it, where it works fine too. However, Firefox will not only run the function, but when this function is within the code of the page, NONE of the JavaScript on that page works, regardless of whether the function is being called or references.
The function calls itself from within itself, but never with any possibility of entering a never-ending loop because of the second parameter.
Can you see any reason why Firefox alone (seemingly) won't run any JavaScript at all when this function is within the source code of the page? I've narrowed it down to this function by deleting the function from the code, and then everything else works perfectly in firefox.
Look forward to any help you are able to offer.
Thanks,
Dave.
I have a function (one of many) which is called onclick of a number of different elements of a form. This function works perfectly (with no detected script errors) in Internet Explorer, and I have even downloaded Opera to check it, where it works fine too. However, Firefox will not only run the function, but when this function is within the code of the page, NONE of the JavaScript on that page works, regardless of whether the function is being called or references.
Code:
// Function to show/hide countries within each IMT based on which IMT(s) is/are selected
function checkIMT(imt, int) {
neiotleadimt = radioValue(document.approvalsform.leadneimt);
if ((neiotleadimt != "ukisa") && (neiotleadimt != "cemaas") && (neiotleadimt != "germanyimt") && (neiotleadimt != "nordic")) {
changeChecks('disable');
} else {
changeChecks('enable');
}
if (imt == "ukisa") {
neiotleadimt = radioValue(document.approvalsform.leadneimt);
if ((neiotleadimt == "ukisa") || (ukisa == true)) {
document.all.ukisacountries.style.display = '';
document.approvalsform.ukisa.checked = true;
} else {
document.all.ukisacountries.style.display = 'none';
}
if (int == "n") {
checkIMT('cemaas', 'y');
checkIMT('germanyimt', 'y');
checkIMT('nordic', 'y');
}
}
if (imt == "cemaas") {
cemaas = document.approvalsform.cemaas.checked;
neiotleadimt = radioValue(document.approvalsform.leadneimt);
if ((neiotleadimt == "cemaas") || (cemaas == true)) {
document.all.cemaascountries.style.display = '';
document.approvalsform.cemaas.checked = true;
} else {
document.all.cemaascountries.style.display = 'none';
}
if (int == "n") {
checkIMT('germanyimt', 'y');
checkIMT('nordic', 'y');
checkIMT('ukisa', 'y');
}
}
if (imt == "germanyimt") {
germanyimt = document.approvalsform.germanyimt.checked;
neiotleadimt = radioValue(document.approvalsform.leadneimt);
if ((neiotleadimt == "germanyimt") || (germanyimt == true)) {
document.all.germanycountries.style.display = '';
document.approvalsform.germanyimt.checked = true;
} else {
document.all.germanycountries.style.display = 'none';
}
if (int == "n") {
checkIMT('cemaas', 'y');
checkIMT('nordic', 'y');
checkIMT('ukisa', 'y');
}
}
if (imt == "nordic") {
nordic = document.approvalsform.nordic.checked;
neiotleadimt = radioValue(document.approvalsform.leadneimt);
if ((neiotleadimt == "nordic") || (nordic == true)) {
document.all.nordiccountries.style.display = '';
document.approvalsform.nordic.checked = true;
} else {
document.all.nordiccountries.style.display = 'none';
}
if (int == "n") {
checkIMT('cemaas', 'y');
checkIMT('germanyimt', 'y');
checkIMT('ukisa', 'y');
}
}
}
The function calls itself from within itself, but never with any possibility of entering a never-ending loop because of the second parameter.
Can you see any reason why Firefox alone (seemingly) won't run any JavaScript at all when this function is within the source code of the page? I've narrowed it down to this function by deleting the function from the code, and then everything else works perfectly in firefox.
Look forward to any help you are able to offer.
Thanks,
Dave.