473,657 Members | 2,845 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4019
wrote on 02 dec 2007 in comp.lang.javas cript:
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.c om/faq/#FAQ4_28>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Dec 2 '07 #2
le********@gmai l.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.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dec 2 '07 #3
le********@gmai l.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.showModa lDialog 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********@gmai l.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
8974
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 up with the yes/No option ok. My problem or question is: How do I determine which button was pressed? Below are the 2 routines I’m using. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles...
1
3402
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 ***********************, I've included all the code incase that isn't where the problem is. Any help would be hugely appreciated. Mick
14
5453
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 that works well as an html page. It brings up a modal popup window that I have been trying to work out for days now and this was the closest I have been able to come. I added a little asp.net code and an asp.net button and cannot get it to
4
2845
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 then submit the form... Could someone correct this lump of code for us pleaseeeeeeee ;o) <input name="Submit" type="button" class="EmployerPostJobForm" value=" Verify Job " id="mFormSubmit" onClick="if(confirm('You are about to verify this...
4
2610
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. How can I use both? Thank you, Tim Meagher
10
15354
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 identical field names. The queries select a subset of the fields, so "Select *" is not really an option. Is there an easy way to change the source of a query, either in the design grid or SQL display? I suppose I could copy the SQL into WordPad...
5
1325
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: System::Windows::Forms::Button * Wolfgang; for (i=1;i<100;i++) { Wolfgang = ???;
2
2441
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
3214
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' & 'Cancel'). Till this point, no problem. Initially, the TextBox is empty. The Button has a property named 'ConfirmMessage' so that the developer using this custom control can modify the question in the confirm dialog. If the user clicks 'OK', I want the...
0
8384
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8302
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8820
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8718
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8601
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
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 we have to send another system
2
1937
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1601
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.