Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JavaScript Code failing without an alert function

Mark.ThompsonJan 18 2014 — edited Jan 20 2014

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?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 17 2014
Added on Jan 18 2014
5 comments
380 views