473,413 Members | 1,799 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,413 software developers and data experts.

Changing the button labels in a confirm box

I am writing a page in French and I need to create a confirm box, but
I want to change the labels of the buttons from "OK" and "Cancel" into
"Oui" and "Non".

I've looked around and it seems impossible to do this, so my question
is: why is the confirm method so restrictive? All it needs is a
question string and two labels for the true and false buttons. Why was
it defined with only one parameter, instead of, let's say one
mandatory and two optional parameters? If there is no reason, then
would it be possible to request a modification to the Javascript
standard? If two optional parameters are added, it would still be
backward compatible, and it would make life easier to those who, like
me, need to write code in other languages.

Please comments.
Dec 2 '07 #1
5 3997
wrote on 02 dec 2007 in comp.lang.javascript:
I am writing a page in French and I need to create a confirm box, but
I want to change the labels of the buttons from "OK" and "Cancel" into
"Oui" and "Non".

I've looked around and it seems impossible to do this, so my question
is: why is the confirm method so restrictive? All it needs is a
question string and two labels for the true and false buttons. Why was
it defined with only one parameter, instead of, let's say one
mandatory and two optional parameters? If there is no reason, then
would it be possible to request a modification to the Javascript
standard? If two optional parameters are added, it would still be
backward compatible, and it would make life easier to those who, like
me, need to write code in other languages.
Confirm() is a browser specific function,
not part of the Javascript specs, methinks.

This Q seems to pop up every week or so.

Please read the FAQ and the archive.

<http://www.jibbering.com/faq/#FAQ4_28>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Dec 2 '07 #2
le********@gmail.com said the following on 12/2/2007 3:11 PM:
I am writing a page in French and I need to create a confirm box, but
I want to change the labels of the buttons from "OK" and "Cancel" into
"Oui" and "Non".
You will have to write your own "in window" confirm box if you want to
have any control at all over what the wording is.

It could be nothing more than a simple div element with a textbox for
input and two buttons to click on.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dec 2 '07 #3
le********@gmail.com wrote:
I am writing a page in French and I need to create a confirm box, but I
want to change the labels of the buttons from "OK" and "Cancel" into
"Oui" and "Non".
It will be most certainly be "Oui" and "Non" in a French user agent (UA) by
default.
[...] If there is no reason, then would it be possible to request a
modification to the Javascript standard?
No. You don't understand that the alert() method has not been part of the
JavaScript language long since, or any other ECMAScript implementation for
that matter. It is part of the DOM, an API provided by the UA, which can be
used with ECMAScript-binded interfaces.

See http://PointedEars.de/es-matrix (updated).
PointedEars
--
"Use any version of Microsoft Frontpage to create your site. (This won't
prevent people from viewing your source, but no one will want to steal it.)"
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
Dec 2 '07 #4
VK
On Dec 2, 11:34 pm, Randy Webb <HikksNotAtH...@aol.comwrote:
You will have to write your own "in window" confirm box if you want to
have any control at all over what the wording is.

It could be nothing more than a simple div element with a textbox for
input and two buttons to click on.
Right - and the modality option? ;-) This question is really a FAQ but
this post stays aside because it is not so much about "how?" but "why
not implemented?" - and the fair answer would be "nobody knows". For
IE it never was a problem because first anyone could bridge JScript to
VBScript MsgBox where the prehistoric limitation in question did not
exist. After window.showModalDialog it really was not a problem at
all. Lucky other are starting to pick up to the current demand, say
upcoming Firefox will have showModalDialog as well:
http://developer.mozilla.org/en/docs...howModalDialog

For the time being one can use different pseudo-modal emulations. Out
of 5sec search for instance:
http://slayeroffice.com/code/custom_alert/
http://javascript.about.com/b/2007/0...dialog-box.htm
Dec 2 '07 #5
Thomas 'PointedEars' Lahn wrote:
le********@gmail.com wrote:
>I am writing a page in French and I need to create a confirm box, but I
want to change the labels of the buttons from "OK" and "Cancel" into
"Oui" and "Non".

It will be most certainly be "Oui" and "Non" in a French user agent (UA) by
default.
Sorry, I meant "OK" and the French equivalent of "Cancel" ("Annuler"?) of
course.
PointedEars
Dec 2 '07 #6

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

Similar topics

5
by: Logger | last post by:
Help, I’m trying to implement a confirm button on an asp.net page. I have it attached to a asp:button control. In the button1 click event I call the CreateConfirmBox subroutine. The Box comes...
1
by: MickG | last post by:
I am trying to change the value of the variable "hard" according to which radio button is pressed and I am having no joy. Could anyone help me with this, the problematic section is marked with...
14
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net...
4
by: @sh | last post by:
Can anyone help out here please, we have a button that when pressed will alert the user, should they cancel no action is taken, however should they confirm, the script will disable the button and...
4
by: Tim Meagher | last post by:
I am trying to use both validation controls and to add submit button attributes, but when I add the button attributes, the javascript fpr the validation controls is no longer created for the page. ...
10
by: Marizel | last post by:
I'm not sure there's an easy solution to this, but thought I'd ask. I often find myself with a query which I'd like to reuse, but with a different datasource. These datasources generally have...
5
by: Wolfgang | last post by:
Dear all, I've a lot of buttons named button1..button100 and want to change some of there propertys. Maintaining the overview I'm looking for a possibility for something like: ...
2
by: Mel | last post by:
is it possible to change Confirm's button labels from OK/Cancel to say Yes/No ? thanks for your help
1
by: rn5a | last post by:
I want to create a custom control that encapsulates a Button & a TextBox. When the Button is clicked, the user is asked a question using JavaScript confirm (which shows 2 buttons - 'OK' &...
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?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...

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.