Solved

Confrim box title

Posted on 2006-11-07
3
2,263 Views
Last Modified: 2008-03-03

Hi Experts,

I am trying to work on the confirm box with "yes" or "no" options and here is my code


<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="JavaScriptt">
---
----

if state == 'CA'
{                  {
var retVal = makeMsgBox("Confirmation","Delete the Contract?",48,4,256,4096);
      
                        if(retVal == 6){                      
                                  submitMe = true;
                          }
                        else                  
                        {
                              submitMe = false;
                              history.back(-1);
                        
                        }
                  }


I am getting the confirm box with "yes" or "no" option, but the title of the confirm box says
"VBScript:Confirmation". Is it possible to Just have a title "Confirmation" and not say VBscript in the tile ?

Thanks for your help
0
Comment
Question by:Tpaul_10
3 Comments
 
LVL 10

Assisted Solution

by:dennis_maeder
dennis_maeder earned 200 total points
ID: 17894231
Tpaul10,

The smart way to get rid of that pesky 'VBScript' in the title is not to use VBScript but javascript.
There is a good workup of the JS alternative at
http://slingfive.com/pages/code/jsMsgbox/
I hope that works for you.

D
0
 
LVL 15

Assisted Solution

by:danrosenthal
danrosenthal earned 100 total points
ID: 17894317
You cannot change remove the VBSCRIPT: from the title. Also VBScript does not work in Firefox. You best bet would be to create a custom Javascript function that builds a window or DIV with your Yes and No options.
0
 
LVL 10

Accepted Solution

by:
iamanindian earned 200 total points
ID: 17895141
Doesn't the default Javascript confirm window work for you? In the simplest form:
------------------------------------------------------------------------------------------
<html>
<head>
<script type="text/javascript">
function disp_confirm()
{
var name=confirm("Press a button")
if (name==true)
{
document.write("You pressed the OK button!")
}
else
{
document.write("You pressed the Cancel button!")
}
}
</script>
</head>

<body>
<form>
<input type="button" onclick="disp_confirm()" value="Display a confirm box">
</form>
</body>

</html>
------------------------------------------------------------------------------------------

Regards
WC
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
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

15 Experts available now in Live!

Get 1:1 Help Now