473,473 Members | 1,489 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Simulating Alert / Confirm

Basically, I have to find a way to hold up execution of a script while
I wait for a button to be clicked, in the same manner as alert() or
confirm() do, but without using either of those.

The basic idea is that an "alert" box is created with one or two
buttons on it, then when a button is clicked the script completes.

I've tried something like

do {
isClicked = confirmClick;
} while (!isClicked);

and the button has onclick='confirmClick=true'

but when I try this, I get an error that the javascript is taking too
long to execute & do I want to cancel it... :(

Is there any way at all to do this? I thought that using a loop like
that would do the trick, but it appears that it won't...

Jan 26 '06 #1
3 2129
Tony wrote on 26 jan 2006 in comp.lang.javascript:
Basically, I have to find a way to hold up execution of a script while
I wait for a button to be clicked, in the same manner as alert() or
confirm() do, but without using either of those.


You cannot, that is not the way js works.

Rewrite your code, so that the rest of the code is in a function executed
on pressing the relevant button.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 26 '06 #2
Evertjan. wrote:
Tony wrote on 26 jan 2006 in comp.lang.javascript:
Basically, I have to find a way to hold up execution of a script while
I wait for a button to be clicked, in the same manner as alert() or
confirm() do, but without using either of those.


You cannot, that is not the way js works.

Rewrite your code, so that the rest of the code is in a function executed
on pressing the relevant button.


That's what I was afraid of - I have a whole team of other developers
working on the server-side code that generates these alerts & confirms
- that's going to add a lot of extra work. I was hoping to avoid that
:(

Ah, well, I guess I should consider it job security...

Jan 26 '06 #3
Tony wrote on 26 jan 2006 in comp.lang.javascript:
Evertjan. wrote:
Tony wrote on 26 jan 2006 in comp.lang.javascript:
> Basically, I have to find a way to hold up execution of a script
> while I wait for a button to be clicked, in the same manner as
> alert() or confirm() do, but without using either of those.
>
>


You cannot, that is not the way js works.

Rewrite your code, so that the rest of the code is in a function
executed on pressing the relevant button.


That's what I was afraid of - I have a whole team of other developers
working on the server-side code that generates these alerts & confirms
- that's going to add a lot of extra work. I was hoping to avoid that
:(

Ah, well, I guess I should consider it job security...


It is a question of the way old programming looked at a programme as a
long line of statements, where the user was not in charge and reluctantly
was allowed to answer preformed questions, while new programming sees the
user as the one GIVING assignments to the programme by pressing a choice
of buttons.

The concept of modularity, started by abolishing the Basic "Goto"
statement, fits perfectly in this concept.

The ww-web also gives the power to the user, and the frustrated
struggling programmers on these NGs are repeatedly asking for independent
server originated actions where all actions should start from the browser
asking the server for action.

;-} / ;-{

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 26 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Andy Fish | last post by:
Hi, now I know what the alert() function does, but can anyone tell me where I can find the specification or standards for functions like alert() and confirm(). They don't seem to be part of...
7
by: Tasha's Dad | last post by:
A description of the problem: 1) Go to a page with various settings and a timeout (forces re-login if over 10 minutes) 2) Before the timeout, make some changes to settings. 3) Press a "reset to...
2
by: Hans | last post by:
Hi! I have an asp application where I use a lot of javascript for validations etc and as it is today I use alert, confirm and prompt dialogs. Now we are adding support for unicode and I have...
2
by: Little Pete | last post by:
I use a simple .js script to shuffle files on my computer to which I'd like to add alert and confirmation boxes. Unfortunately I haven't been able to figure out what object I need to create that...
4
by: sonu | last post by:
How can we use alert and confirm method in asp.net application. i am working with application where i want to use confirm box before going for any operation. and same for alert box Sonu
3
by: Darrel | last post by:
I have a page that lists a bunch of items. You can check each item and hit ADD to add these items to a record in the DB. This page has a dropDownList. When you select an item from the list, I...
8
by: Guy Cohen | last post by:
Hi all How do I present questions/messages to the user while I am in a CLICK event of a button ? I was told to look for javascript/vbscript but could not make it work. Please advise Guy
5
by: Xu, Qian | last post by:
Hello All, I have some problem by simulating a link click using javascript. The webpage uses a js-library named interface (jQuery like) ------------------------------ <a id="foo" href="#">Try...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.