Change 'ok' and 'cancel' to some other text

S

Steve

Asp.NET 2.0

For a button control I have set the following:

OnClientClick="return confirm('Are you sure you want to do this?');"

Of course the 'OK' and 'Cancel' buttons come up for the user.

However I am developing this page in another language and I don't want
it to say 'OK' or 'Cancel', I want to be able to specify the text for
each button. Any ideas?
 
T

Tasos Vogiatzoglou

You can't. The locale of the dialog is determined by the locale of the
system and the IE language, because Confirm dialog is a component of
Internet Explorer where you don't have direct control.

Regards,
Tasos
 
L

Laurent Bugnion

Hi,
Asp.NET 2.0

For a button control I have set the following:

OnClientClick="return confirm('Are you sure you want to do this?');"

Of course the 'OK' and 'Cancel' buttons come up for the user.

However I am developing this page in another language and I don't want
it to say 'OK' or 'Cancel', I want to be able to specify the text for
each button. Any ideas?

alert, input and prompt were created mostly for debugging purposes in
the good ol' times where we didn't have any client-side debuggers. I
wouldn't use them anymore if you can avoid it.

I posted some code a long time ago showing how to use a pop-up to do
what you want. I wouldn't really use that code anymore (pop-ups are
questionable due to pop-up blockers and to their ugly look), but maybe
you can get an idea by looking at the code.

Nowadays, I would use an absolute positioned DIV to simulate the alert box.

Here is the old code:
http://www.galasoft-lb.ch/myjavascript/consulting/2000090401.html

HTH,
Laurent
 

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

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,158
Latest member
Vinay_Kumar Nevatia
Top