Link to home
Start Free TrialLog in
Avatar of Coast Line
Coast LineFlag for Canada

asked on

VBScript Confirm Dialog Box

Hi, We have one query!

I want to show the Confirm box with VBScript but the issue is!

1. The Confiorm dialog box shows the VBSCRIPT in title, that i do not need.
2. Also in the OK/Cancel i want to see the Yes/No Button.

Please guide what needs to be Done. The Application is IE Specific only

No Changes can be made to DLL or registry, Is this Progmatically possible

Guide

Thanks
Avatar of edemcs
edemcs
Flag of United States of America image

MsgBox("Confirmation message",1,"Your own title")
Sorry, switch 1 to 4 for Yes/No.
Avatar of Coast Line

ASKER

Thanks, But it is unable to remove the VBSCRIPT:  from the confirm dialog Boc, Please check on this

i want to remove that also!
ASKER CERTIFIED SOLUTION
Avatar of edemcs
edemcs
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
there must be some way
Avatar of Dhugal_L
Dhugal_L

Use Javascript "confirm" or "alert":

http://www.w3schools.com/js/js_popup.asp
na! VBscript preferred i told in my post
Hi, you need to MsgBox, as opposed to WScript.Echo

intReturn = MsgBox("This is your prompt", vbYesNo, "This is your title")

Regards,

Rob.
I do not know but i have told in my post that i do not want the title VBSCRIPT to appear,
I guess you are using MsgBox in an HTML page via Internet Explorer.

edemcs was telling you the truth.  You cannot stop the VBScript: prefix to the title.  The only way to not have the VBScript: prefix in the title when calling a message box from an HTML page is to generate a messagebox not using VBScript code in your web page.

As both edemcs and Dhugal_L advised, you can use Javascript instead, but then the message box will have "Message from webpage" in the title.  (more on Javascript message boxes: http://www.w3schools.com/JS/js_popup.asp).   Try sample below:
<html>
<head>
</head>
<body>

There will be two message boxes, one using vbScript and one using Javascript.

<script type="text/vbscript">
MsgBox "Message using VBScript", vbYesNo + vbQuestion, "Title baby"
</script>

<script type="text/javascript">
confirm("Message using Javascript");
</script>

</body>
</html>

Open in new window


So: You either use one of the methods to generate a basic message box as suggested by posters above, or use a more complex popup method to generate a custom one exactly to your taste:
   Example 1:  http://www.htmlcodetutorial.com/linking/linking_famsupp_72.html
   Example 2:  http://msdn.microsoft.com/en-us/library/ms533025(v=vs.85).aspx

Good luck,
Daz.