Call VBScript from HTML Button

Hi Experts:

How do I call client side VBScript using an HTML button?

My application is PHP5, HTML,  MySQL  based running on WinXP Pro, SP2.  I'm using WAMP2 as my LAMP.  (

For the button Click event, I want to pass two values stored in HTML text fields to the VBScript.  Call them businessUnit and glAccount.  When the script finishes executing, I want to return a value  from the VBSCript to the HTML page and and place that value in a text field .  Call it returnStatus.   See Code Snippet below.

Please be sure to address the two pass variables and the one return variable.

Note, in the code snippet the text fields "value=" are PHP variables.

'Thanks much,
<input name="businessUnit" type="hidden" value="$bu" />
<input name="glAccount"    type="hidden" value="$glAccount" />
<input name="returnStatus" type="text" value="<?=$returnStatus?>" size="8" maxlength="8"/>

Open in new window

Who is Participating?
gops1Connect With a Mentor Commented:
Is it something like this:

		<title>Script Demo Gops</title>
		<script language="VBScript">
			Sub ProcessPayroll()
				Dim val1, val2
				val1 = int(Document.test.businessUnit.Value)
				val2 = int(Document.test.glAccount.Value)
			End Sub
	<form name="test">
		<input name="businessUnit" type="hidden" value="200" />
		<input name="glAccount"    type="hidden" value="300" />
		<input name="returnStatus" type="text" value="" size="8" maxlength="8"/>
		<input type="button" value="Click Me" onClick="ProcessPayroll()">

Open in new window

IT79637Author Commented:
Upped point value to 500.
IT79637Author Commented:
Thanks much!!!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.