473,804 Members | 2,946 Online
Bytes | Software Development & Data Engineering Community
+ 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='confir mClick=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 2137
Tony wrote on 26 jan 2006 in comp.lang.javas cript:
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.javas cript:
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.javas cript:
Evertjan. wrote:
Tony wrote on 26 jan 2006 in comp.lang.javas cript:
> 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
18443
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 the ECMAScript language but aren't part of the DOM either. Now we seem to be finally reaching a stage of standards-compliant browsers, there seems to be a bit of a gap here.
7
11152
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 defaults" button that uses a confirmation box to let the user know what is about to be reset (lists items). 4) Walk away while the confirm box is displayed and come back after the page timeout. 5) My screen now has the page, a confirm popup on top...
2
2840
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 problems with the font used to present messages in alert, prompts and confirm dialogs. If I for examle paste a chinese value in a prompt dialog it is shown om my machine as a vertical bar. When I write the value back to a textbox <input type="text"...
2
2283
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 has these methods. What is missing from this .js script: var source = "source.txt"; var destination = "destination.txt"; if (confirm("Make Changes?")) {
4
10390
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
2655
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 want to do an auto-postback and then list a new bunch of items that you can, again, check and click on ADD. If a person has items checked, and then changes the DDL BEFORE cliccking on ADD, I want to pop-up a confirmation 'do you want to add these...
8
1903
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
3811
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 try try</a> $('#foo').click(function(){ $('ul',this.parentNode).BlindToggleVertically(500); this.blur(); return false;
0
9704
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9571
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10561
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10318
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7608
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6845
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5639
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4277
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.