Solved

Confrim box title

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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…
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…

821 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