emmanuuel pascal
emmanuuel pascal

Reputation: 31

Correct usage of VBScript's MsgBox

I require to display some text in the browser with some words in between as links. On click of the links I want to display a pop up dialog with just some text and an OK button.

I want the title of the Pop up dialog to be changeable via code and also the icon to be the information icon. I use a JavaScript alert box which always has a heading of pop up as "Message from web page".

I think it can done using VBScript. What is the correct usage of VBScript? PFB the sample using JavaScript, I need this to be tweaked, so that VBScript is used and MsgBox is used.

<html>
<head>
    <script type="text/javascript">
        fucntion(test){
            alert(test)
        }
    </script>
</head>

<body>
    This is my <a href="javascript:void(o)" onclick="test('This is test')">link</a> which
    you can click on for definition.
</body>
</html>

Upvotes: 0

Views: 1541

Answers (1)

emmanuuel pascal
emmanuuel pascal

Reputation: 31

This works fine. 64 is for the information icon and OK button. But I not able to get rid of "vbscript:" which is present at the start of the title. I am not sure why it is like that.

<html>
<head>
    <script type="text/vbscript">
        Function myPopUp(test)
            MsgBox test, 64, "My Custom Title"
        End Function
    </script>
</head>

<body>
    This is my <a href="#" language="vbscript" onclick="myPopUp('How are you do
    today')">link</a> which
    you can click on for definition.
</body>
</html>

Upvotes: 1

Related Questions