![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Execute VBScript from a floating popup menu Please help, I am desperate! On my web html-php-mysql page, I use vbscript to execute method calls to an automation server (Dephi 7, apartment threaded, out-of-process) for a document imaging application. I can execute the methods via vbs fine when I use an html form element which has an event, such as onKeyDown, onClick, etc. I want to move some button functions to a popup menu I created using UltraMenu. For each menu item, UltraMenu provides a link input area to execute code corresponding to the corresponding menu item(s). I used this: http://localhost/resume3/vchrAdd.php?id=8. The "8" is an action flag to execute the above vbs script. In php: if ($action==8) { $scripter = new COM("MSScriptControl.ScriptControl"); $scripter->Language = "vbscript"; $k = $scripter->eval("UnBusyInvoice()"); <<-- both double and single quotes fail. print "Result: $k\n"; $scripter = null; } This code throws an error: Fatal error: Uncaught exception 'com_exception' with message Source: Microsoft VBScript runtime error Description:Type mismatch: 'UnBusyInvoice'' in C:\wamp\www\resume3\vchrAdd.php:207 Stack trace: #0 C:\wamp\www\resume3\vchrAdd.php(207): com->eval('UnBusyInvoice()') #1 {main} thrown in C:\wamp\www\resume3\vchrAdd.php on line 207 1. Is there a way to execute the subroutine in html, but use an action event that ALWAYS executes vs. onClick="vbs o_Something()" which requires a personto do something? if ($action==8) { ?> -->>> enter html code to execute ( vbs:UnBusyInvoice() ) automatically w/o an onClick event <? } 2. Or is there a cleaner way I can execute the vbs subroutine UnBusyInvoice() which resides in the <head></head> section. Some crazy html like: <input name="unBusyInv" id="unBusyInv" onAlwaysDoThis="vbs:UnBusyInvoice()" class="btn-filler-blue" value="UnBusy Invoice" type="text"> Thanks much. |
My System Specs![]() |
| | #2 (permalink) |
| | RE: Execute VBScript from a floating popup menu ADDENDUM: My vbscript is in the <head></head> section of the web page. The UnBusyInvoice subroutine follows: Sub UnBusyInvoice() Dim vDocID, vStatus, iResult vDocID = document.getElementByID("docID").value if not isobject(mySrvObj) then Set mySrvObj = parent.hidden.MasterSrvObj end if iResult = mySrvObj.UnBusyInvoice(vDocID, vStaus) if vStatus = 0 then document.getElementByID("docID").value = "" end if document.getElementByID("status1").value = vStaus End sub |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Execute vbscript using cscript.exe on remote machine using Powershell | PowerShell | |||
| execute mysql query using vbscript | VB Script | |||
| Applications do not execute from Desktop nor base Start Menu | Vista performance & maintenance | |||
| Applications do not execute from Desktop or base Start Menu | Vista account administration | |||