473,406 Members | 2,847 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,406 software developers and data experts.

Js confirm box

Is there any way to change the text in Ok and Cancel in Javascript confirm box?
Instead of OK and Cancel i want checkout and continue shopping.

I have my js code like this
Expand|Select|Wrap|Line Numbers
  1. function CheckWt()
  2. {
  3.  var backorder = 'False'
  4.  
  5. if (backorder == 'False')
  6.  {
  7.  if (parseInt(document.getElementById('ctl00_MainContent_ShoppingCart1_ThemeShoppingCart1_lblBalWeight').innerHTML) > 0)
  8.  {
  9.  var ans = confirm('You have not reached your weight limit yet.\nClick "OK" if you would like to add more items to your cart. Click "Cancel" to proceed to checkout'); if (ans )
  10.   {
  11.   return false;
  12.   }
  13.   else
  14.   {
  15.   return true;
  16.   }
  17.   }
  18.  else
  19.  {
  20.  return true;
  21.  }
  22.  }
  23.  else
  24.  {
  25.  alert('Please Update the Quantity of the items that exceeds the available stock\nOr Click On Update To Stock Button ');
  26.  
  27.  return false;
  28.  }
  29. }
Mar 31 '08 #1
3 1941
pronerd
392 Expert 256MB
Not really. You can using a pop-up window or a dynamically created layer and insert what ever buttons/content you want.
Mar 31 '08 #2
Thanks for answer
But how do i create layer dynamically?
Mar 31 '08 #3
pronerd
392 Expert 256MB
how do i create layer dynamically?
There are two ways :

1. The easy way is to have the layer in the page with its display attribute set to none so it will not be shown. You can then use JavaScript to set its display attribute to either 'block' or 'inline' to make it visable when you want it to be displayed.


[HTML]<HTML>
<div id="hiddenLayer" style="position: absolute; top: 150px; left:150px; display: none;" >Hey look its the hidden layer</div>
<input type="button" id="showLayer" label="ShowLayer" onClick="showTheLayer()" />
<script>
function showTheLayer() {

var layer = document.getElementById('hiddenLayer');
layer.style.display ='block';
}
</script>
</HTML>[/HTML]




2. The other way would be to use the DOM API to create the DIV elements and then add them to the page. This is much more involved. You can google for specific examples.
Apr 1 '08 #4

Sign in to post your reply or Sign up for a free account.

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...
0
by: Joe Finsterwald | last post by:
Recently I needed to add a confirm to a LinkButton that called a JavaScript function on success, and did nothing on failure. I found documentation on adding a confirm, but not on how to place a...
13
by: Chris | last post by:
I can create Javascript confirm message boxes during page creation, etc adding them to the button attributes (many good posts on this!). But how can I add this event after the button is pressed? I...
1
by: freshRecruit | last post by:
Hi, I am having a problem, and is driving me nuts and my deadline is fast approaching. Please do help me.. This is a webapplication with a usercontrol which has some buttons for adding,...
1
by: chris | last post by:
Hi, In ASP.NET page, when my user tries to edit a record in gridview, I need to display a confirmation message, if another user is editing the same record. Since the confirmation message will...
4
by: tfsmag | last post by:
Okay, I have a project management app i'm writing and in the left hand menu i have a treeview control that is populated with each project... in child nodes under each project node I have an "edit"...
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...
5
by: strikefiend | last post by:
Ok, I'm somewhat new to .NET C# language and am having a bit of trouble. I'm trying to run the javascript confirm() method from my ascx page but I'm currently using C# as the main language of the...
4
by: mamun | last post by:
Hi All, I have the following situation and am looking for answer in C#. I have a datagrid and putting checkbox next to each record. In the header I have a Delete button. I want users to...
4
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I change the confirm box to say yes/no or default to cancel?...
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...
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
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...
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.