Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Call VBScript from HTML Button

Posted on 2008-06-17
3
4,306 Views
Last Modified: 2013-11-25
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.  (http://www.wampserver.com/en/)

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,
Cheers!
<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

0
Comment
Question by:IT79637
  • 2
3 Comments
 
LVL 1

Author Comment

by:IT79637
ID: 21807955
Upped point value to 500.
0
 
LVL 17

Accepted Solution

by:
gops1 earned 500 total points
ID: 21809819
Is it something like this:


<html>
	<head>
		<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)
 
				Document.test.returnStatus.Value=val1+val2
			End Sub
 
		</script>
</head>
<body>
	<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"/>
 
		<br>
		<input type="button" value="Click Me" onClick="ProcessPayroll()">
	</form>
</body>
</html>

Open in new window

0
 
LVL 1

Author Closing Comment

by:IT79637
ID: 31468131
Thanks much!!!
Cheers.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Html Table looping 4 25
How to resize a div in html 3 35
ability to create nested list on the UI using PHP, HTML, Javascript 7 42
get the ALL CAPITAL words from a cell 4 19
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remaiā€¦
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question