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

Home Posts Topics Members FAQ

FAQ Topic - How do I change the confirm box to say yes/no or default to cancel?

-----------------------------------------------------------------------
FAQ Topic - How do I change the confirm box to say yes/no
or default to cancel?
-----------------------------------------------------------------------

The buttons on a confirm box cannot be changed, nor can you
specify a default button. However, you should be able to change
the question so that "OK" is suitable as the default.
e.g. change "We will now buy ourselves a porsche with your credit
card, Do you want to continue with this transaction _OK_ Cancel"
to "We will now buy ourselves a porsche with your credit card,
Would you like to abandon this transaction? _OK_ Cancel"
===
Postings such as this are automatically sent once a day. Their
goal is to answer repeated questions, and to offer the content to
the community for continuous evaluation/improvement. The complete
comp.lang.javascript FAQ is at http://jibbering.com/faq/index.html.
The FAQ workers are a group of volunteers.

Mar 7 '07 #1
4 8623
FAQ server wrote on 07 mrt 2007 in comp.lang.javascript:
-----------------------------------------------------------------------
FAQ Topic - How do I change the confirm box to say yes/no
or default to cancel?
-----------------------------------------------------------------------

The buttons on a confirm box cannot be changed, nor can you
specify a default button. However, you should be able to change
the question so that "OK" is suitable as the default.
e.g. change "We will now buy ourselves a porsche with your credit
card, Do you want to continue with this transaction _OK_ Cancel"
to "We will now buy ourselves a porsche with your credit card,
Would you like to abandon this transaction? _OK_ Cancel"
Beware:

Those two words depend on regional settings of the client!

"Do you want to continue with this transaction _OK_ Cancel"

So a question cannot be that specific.

[IE, FF, ??]
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 7 '07 #2
In comp.lang.javascript message <Xn********************@194.109.133.242>
, Wed, 7 Mar 2007 10:12:30, Evertjan. <ex**************@interxnl.net>
posted:
>FAQ server wrote on 07 mrt 2007 in comp.lang.javascript:
>-----------------------------------------------------------------------
FAQ Topic - How do I change the confirm box to say yes/no
or default to cancel?
-----------------------------------------------------------------------

The buttons on a confirm box cannot be changed, nor can you
specify a default button. However, you should be able to change
the question so that "OK" is suitable as the default.
e.g. change "We will now buy ourselves a porsche with your credit
card, Do you want to continue with this transaction _OK_ Cancel"
to "We will now buy ourselves a porsche with your credit card,
Would you like to abandon this transaction? _OK_ Cancel"

Beware:

Those two words depend on regional settings of the client!

"Do you want to continue with this transaction _OK_ Cancel"

So a question cannot be that specific.
Surely that's not so important, because anyone who can read the English
will understand the meaning at least of OK and probably of Cancel, and
can press the local-language equivalent. Exception example : a monoglot
English-user using a computer set for Japanese - but that's rather a
silly thing to try without an interpreter.

However, AISB, "porsche" should be "Porsche". Why not change it to
"elephant", if capitals are disliked?

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/&c., FAQqy topics & links;
<URL:http://www.merlyn.demon.co.uk/clpb-faq.txt RAH Prins : c.l.p.b mFAQ;
<URL:ftp://garbo.uwasa.fi/pc/link/tsfaqp.zipTimo Salmi's Turbo Pascal FAQ.
Mar 7 '07 #3
On Mar 6, 6:00 pm, "FAQ server" <javascr...@dotinternet.bewrote:
-----------------------------------------------------------------------
FAQ Topic - How do I change the confirm box to say yes/no
or default to cancel?
-----------------------------------------------------------------------

The buttons on a confirm box cannot be changed, nor can you
specify a default button. However, you should be able to change
the question so that "OK" is suitable as the default.
e.g. change "We will now buy ourselves a porsche with your credit
card, Do you want to continue with this transaction _OK_ Cancel"
to "We will now buy ourselves a porsche with your credit card,
Would you like to abandon this transaction? _OK_ Cancel"

for those who don't know- a confirm box can be called like this:

var x = window.confirm("LOL!!!!1111oneoneone.")

where window.confirm() returns a boolean depending on which button the
user clicks- "OK" (true) or "Cancel" (false). Probably why you
shouldn't be able to change what the buttons say... If the user
closes the confirm dialog (doesn't select ok or cancel)
window.confirm() returns false.
Mar 7 '07 #4
Dr J R Stockton wrote on 07 mrt 2007 in comp.lang.javascript:
In comp.lang.javascript message
<Xn********************@194.109.133.242, Wed, 7 Mar 2007 10:12:30,
Evertjan. <ex**************@interxnl.netposted:
[..........]
>>Beware:

Those two words depend on regional settings of the client!

"Do you want to continue with this transaction _OK_ Cancel"

So a question cannot be that specific.

Surely that's not so important, because anyone who can read the
English will understand the meaning at least of OK and probably of
Cancel, and can press the local-language equivalent. Exception
example : a monoglot English-user using a computer set for Japanese -
but that's rather a silly thing to try without an interpreter.
Not at all.

Visualize a English native wanting to access his webmail in a Japanese
internet cafe:

---------------------------------------------------------------
Do you want to send this mail? Choose between _OK_ and Cancel.
$@#$Sushi@#$ ^***^8Kamikazi6868
---------------------------------------------------------------
However, AISB, "porsche" should be "Porsche". Why not change it to
"elephant", if capitals are disliked?
Wrong NG, try:
<news:alt.fancy.cars.and.big.game.outside.capital. cities.like.Nairobi>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 7 '07 #5

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

Similar topics

4
20933
by: JohnSouth104 | last post by:
Hi I want to warn the user that changing the selected item in a pull-down will clear some data he has already entered in a file download box. I've tried using confirm() to return true or false...
8
4005
by: rn5a | last post by:
I have gone through a no. of posts in this NewsGroup regarding my problem but alas, couldn't come across one which would have helped me in resolving the issue. My problem is this: An ASPX Form...
2
635
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I change the confirm box to say yes/no or default to cancel?...
5
11638
by: GiJeet | last post by:
Hello, I'm trying to figure this code out. <input type="submit" onclick="if(!confirm('Are you sure?') return false; "... /> I know that if you return false in an event like this onclick it...
3
3131
by: swethak | last post by:
Hi, I want to applying the styles for confirm box. For this purpose i have used below code. Here i am writting my code <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">...
0
6918
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
7102
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
6756
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
7003
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...
0
5357
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,...
1
4798
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...
0
3008
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
1310
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 ...
1
570
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.