473,378 Members | 1,078 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,378 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 8613
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">...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.