Help!! I'm running into something that just makes no sense.
This JavaScript works perfectly. The last line resets a radio group to its first value.
function Category_Changed()
{
$s('P32_COURSE_CAT_SL',$v('P32_COURSE_CAT_RG'));
alert('hello');
$s('P32_COURSE_SUBCAT_SL','All Courses');
document.getElementById("P32_COURSE_SUBCAT_RG_0").checked = true;
}
Here's the strange part: If I take out the alert command, or comment it out, the JavaScript fails to run properly. Firebug does not show an error, but the radio group does NOT get reset to its first value.
Even stranger, if I MOVE the alert command up or down, the JavaScript fails. The alert command has to be exactly where you see it, or the radio group does not get reset. With or without the alert, the two $s commands run properly. It's only the last line - the reset of the radio button - that isn't firing properly, but also isn't throwing an error, when the alert is removed.
Why in the world should the presence or absence of an alert, and/or its exact positioning, have any effect on whether or not a JavaScript function runs properly or not?