473,401 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

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 8619
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
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
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
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I change the confirm box to say yes/no or default to cancel?...
5
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
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
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
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
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
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...

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.