File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Probelm with alert box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Probelm with alert box" Watch "Probelm with alert box" New topic

Probelm with alert box


Joined: Aug 24, 2007
Posts: 1
I'm facing strange problem due to an alert box.

I have 2 combo boxes (DROP DOWN MENUS)
I am filtering the options displayed in the second drop-down menu based on the option selected in the first drop-down menu.

I had used some alert boxes for debugging while writing the code.
Once the code was working fine, I removed the alert boxes.
Strangely the filtering stopped working and the second-drop down menu started displaying the default option instead of the options based on the filtering logic.

If i put an alert box before the code that has the filtering logic (basically a for loop), the options are filtered correctly.

Does the alert box have any impact on refreshing the values of combo boxes (in the view mode)??? Is there something that can be done to avoid this problem?
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2591

Problem is probably due to time delay that alert box causes. You can try setTimeout to do the same.
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
What is the code you are using? Showing us some code will make it easier for us to tell you what is wrong.

I agree. Here's the link:
subject: Probelm with alert box
It's not a secret anymore!