Link to home
Start Free TrialLog in
Avatar of 1958
1958

asked on

custom alerts and confirms

I am trying to code a function for custom confirms and alerts my problem
is this. I can easily get the windows to open and stay on top but as with a regular
confirm and or alert I need to get program execution to wait until the
confirm or alert has been answered. does anyone know how to pull this
off.
ASKER CERTIFIED SOLUTION
Avatar of Holger101497
Holger101497

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 1958
1958

ASKER

I wanted to create a function that could easily be called from anywhere in the code and would act much like the msgboxes is VB.
in order to do that I need to stop program execution and wait for  the msgbox to be answered as you stated a while loop uses up the cpu and if I use recursion I get the error too much recursion. is this even possible to do.
sorry, I haven't forgotten you... just don't have quite as much time during the week as during the weekends...

I'll find something, but it won't be 100% what you want to do, because I don't think there is any way to "pause" a JavaScript-Code. The best I/you can do is to open a window and specify which code should be executed when it is closed (just like the "CheckPwdEnd()" in my example). Unfortunately, there's nothing that makes the code "pause" or "sleep" (I think that's quite an important command that's missing here!).

I really don't know why this can't be done in NN, but there are two major problems:
1] a function will always return before you have a result (unless you use a loop that blocks the CPU). You will have to split your code into one part that executes before the window is opened and one part that executes when it is closed...
2] You don't get the prompt modal. The closest you get is by doing what I did for NN4 - blocking the main window with an onfocus that activates the prompt. Because of what seems to be a bug in NN3, I wouldn't recommend it for NN3.

Let me know what you think and I'll try to find something that comes as close to what you want as possible...

I'll also try to post this question in the Netscape DevEdge newsgroups and see what happens....
well... once again sorry for taking a long time for comments, I'm really pretty busy and don't even answer new questions at the moment...

I did get an idea from Netscape newsgroups how to make the opening window modal and maybe waiting wouldn't be as critical any more then... the user can't do anything before he closes the prompt window... I still don't see a very nice way of simply calling it like an alert and assume that the data is there in the next line :-((

I'll try to post a "demo" in the next couple of days...