Solved

confirm box with Yes and No options

Posted on 2006-06-16
3
1,296 Views
Last Modified: 2012-08-14
how to make a confirm box with Yes and No buttons instead of Ok and Cancel in javascript.
0
Comment
Question by:jayvit
3 Comments
 
LVL 63

Accepted Solution

by:
Zvonko earned 50 total points
ID: 16919837
For IE only>

<HTML>
<HEAD>
<TITLE>Confirm</TITLE>
<script language="VBScript">
<!--
Function makeMsgBox(title,message,icon,buttons,defButton,mode)
   butVal = icon + buttons + defButton + mode
   makeMsgBox = MsgBox(message,butVal,title)
End Function
// -->
</script>
<script language="Javascript">
function confirmDelete(){
  //http://www.webreference.com/dhtml/column22/js-vbMsgBox.html
  var retVal = makeMsgBox("Confirmation","Delete Record?",48,4,256,4096);
  // which button was pressed?
  if(retVal == 6){
    alert('Delete prcessing');
    return true
  } else {
    alert('Delete aborted');
    return false
  }
}
</script>
</HEAD>
<BODY>
<form>
<INPUT TYPE=button Value="Delte" onClick="alert(confirmDelete())">
</BODY>
</HTML>

0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now