Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-07-2012, 11:45 AM   PM User | #1
ramanarayana
New to the CF scene

 
Join Date: May 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
ramanarayana is an unknown quantity at this point
Post Change confirm dialog box button label from "Ok" to "Yes"

Hi,

In my project i am using java script confirm dialog box and i want to change label from "ok" to "yes" and "cancel" to "no"

We can see "Ok" "Cancel' label button on dialog box.

Could you please tell me it is possible to change, if not any other way to change?


Thanks in advance.
ramanarayana is offline   Reply With Quote
Old 05-07-2012, 04:02 PM   PM User | #2
EpicWebDesign
Regular Coder

 
Join Date: Apr 2012
Posts: 165
Thanks: 1
Thanked 39 Times in 39 Posts
EpicWebDesign will become famous soon enough
That should be a fairly easy fix. If you post your code, I can show you what/where you need to edit.
EpicWebDesign is offline   Reply With Quote
Old 05-07-2012, 04:24 PM   PM User | #3
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,392
Thanks: 18
Thanked 351 Times in 350 Posts
sunfighter is on a distinguished road
I do not think you can change the confirm dialog box button dialog, but you can make your own confirmation box:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>New document</title>
<style type="text/css">
div#fake_box{
	position: absolute;
	top: 100px;
	left: 200px;
	height: 88px;
	width: 200px;
	border: solid black 2px;
	background-color: gray;
	color: black;
	text-align:center;
	display:none;
}
</style>
<script type="text/javascript">
function show_box()
{
    document.getElementById("fake_box").style.display = "block";
}

</script>
</head>

<body>
<button onclick="show_box()">A question</button>
<div id="fake_box">
	<br>What are you wearing<br><br>
	<button style="float:left;">Yes</button>
	<button style="float:right;">No</button>
</div>

</body>
</html>
sunfighter is offline   Reply With Quote
Old 05-07-2012, 08:22 PM   PM User | #4
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,465
Thanks: 0
Thanked 499 Times in 491 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
You should always make your own dialog boxes in JavaScript - the built in ones are only there for debugging purposes.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:08 PM.


Advertisement
Log in to turn off these ads.