Solved

Confrim box title

Posted on 2006-11-07
3
2,272 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…
Suggested Courses

615 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