How to embed VBSCRIPT inside HTML-VBForums
Results 1 to 3 of 3

Thread: How to embed VBSCRIPT inside HTML

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2016
    Posts
    6

    How to embed VBSCRIPT inside HTML

    I have a working VBScript that launches/open calendar invite with prepopulated recipient. I need to add a dropdown list for users to pick a selection, prepopulated recipient would be filled based on their selection.
    When I run the html file it only executes the HTML code but never got into the VBScript code.
    Also I am interested to do the dropdown in VBScript without the html. Any guidance or direction greatly appreciated.

    Here is what I am trying to do:
    Code:
    Code:
    <html>
    <head>
    <HTA:APPLICATION ID="2014-03"
       applicationName="2014-03"
       version="1.1"
        BORDER="thin"
        BORDERSTYLE="static"
        CAPTION="Yes"
        CONTEXTMENU="no"
        ICON="C:\icon\32x32.ico"
        INNERBORDER="no"
        MAXIMIZEBUTTON="no"
        MINIMIZEBUTTON="no"
        NAVIGATABLE="no"
        SCROLL="no"
        SCROLLFLAT="no"
        SELECTION="no"
        SHOWINTASKBAR="yes"
        SINGLEINSTANCE="yes"
        SYSMENU="yes"
        WINDOWSTATE="normal" 
    >
    
    <SCRIPT LANGUAGE="VBScript">
    
        Sub WindowsLoad()
    
        Select Case inp01
    
        Case "1"
            msgBox "Option 1 Selected!"
    'do something here
        End Sub 
    
       
    </SCRIPT>
    </head>
    
    <body>
    <select id=extension size="1" name="OptionChooser" onChange="TestSub"> <option value="0">Select Option</option> <option value="1">One</option> <option value="2">Two</option> <option value="3">Three</option> <option value="4">Four</option> </select> <input Type = "Button" Value = "Launch Meeting Invite" Name = "Run_Button" onClick = "WindowsLoad"><p></td> </body> </html>

  2. #2

    Thread Starter
    New Member
    Join Date
    Sep 2016
    Posts
    6

    Re: How to embed VBSCRIPT inside HTML

    I have a working VBScript that launches/open calendar invite with prepopulated recipient. I need to add a dropdown list for users to pick a selection, prepopulated recipient would be filled based on their selection.
    When I run the html file it only executes the HTML code but never got into the VBScript code.
    Also I am interested to do the dropdown in VBScript without the html. Any guidance or direction greatly appreciated.

    Here is what I am trying to do:


    1.
    Code:
    <html>
    2.	<head>
    3.	<HTA:APPLICATION ID="2014-03"
    4.	   applicationName="2014-03"
    5.	   version="1.1"
    6.	    BORDER="thin"
    7.	    BORDERSTYLE="static"
    8.	    CAPTION="Yes"
    9.	    CONTEXTMENU="no"
    10.	    ICON="C:\icon\32x32.ico"
    11.	    INNERBORDER="no"
    12.	    MAXIMIZEBUTTON="no"
    13.	    MINIMIZEBUTTON="no"
    14.	    NAVIGATABLE="no"
    15.	    SCROLL="no"
    16.	    SCROLLFLAT="no"
    17.	    SELECTION="no"
    18.	    SHOWINTASKBAR="yes"
    19.	    SINGLEINSTANCE="yes"
    20.	    SYSMENU="yes"
    21.	    WINDOWSTATE="normal" 
    22.	>
    23.	
    24.	<SCRIPT LANGUAGE="VBScript">
    25.	
    26.	    Sub WindowsLoad()
    27.	
        Select Case inp01
    1.	    Select Case inp01
    2.	
    3.	    Case "1"
    4.	        msgBox "Option 1 Selected!"
    5.	'do something here
    6.	    End Sub 
    7.	   
    8.	    Case "2"
    9.	        msgBox "Option 2 Selected!"
    10.	'do something here
    11.	    End Sub 
    12.	
    13.	   
    14.	</SCRIPT>
    15.	</head>
    16.	
    17.	<body>
    18.	
    19.	<select id=extension size="1" name="OptionChooser" onChange="TestSub">
    20.	    <option value="0">Select Option</option>
    21.	    <option value="1">One</option>
    22.	    <option value="2">Two</option>
    23.	    <option value="3">Three</option>
    24.	    <option value="4">Four</option>
    25.	</select>
    26.	
    <input Type = "Button" Value = "Launch Meeting Invite" Name = "Run_Button" onClick = "WindowsLoad"><p></td>
    </html>

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2016
    Posts
    6

    Re: How to embed VBSCRIPT inside HTML

    I even tried to use this simple example. On click it should display"Button Pressed". I get the button but nothing happen when pressing the button.

    I am on IE11.

    Code:
    <HTML>
    <HEAD>
    <TITLE>Test Button Events</TITLE>
    </HEAD>
    <BODY>
    <FORM NAME="Form1">
       <INPUT TYPE="Button" NAME="Button1" VALUE="Click">
       <SCRIPT FOR="Button1" EVENT="onClick" LANGUAGE="VBScript">
          MsgBox "Button Pressed!"
       </SCRIPT>
    </FORM>
    </BODY>
    </HTML>

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.