Solved

Confrim box title

Posted on 2006-11-07
3
2,265 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
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…

815 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

12 Experts available now in Live!

Get 1:1 Help Now