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

F

FAQ server

-----------------------------------------------------------------------
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.
 
E

Evertjan.

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, ??]
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]>
FAQ server wrote on 07 mrt 2007 in comp.lang.javascript:


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?
 
W

Walton

-----------------------------------------------------------------------
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.
 
E

Evertjan.

Dr J R Stockton wrote on 07 mrt 2007 in comp.lang.javascript:
In comp.lang.javascript message
<[email protected]> , Wed, 7 Mar 2007 10:12:30,
Evertjan. <[email protected]> posted: [..........]
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:
<
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top