VBScript in HTML Pages

08-21-2002, 08:16 AM
In one of the HTML pages that i am developing i have a VBScript procedure which works fine, is there any way i can get to the information stored in the variables declared in VBScript into the HTML script?

08-21-2002, 11:13 AM
Not sure what you mean? HTML script? The VBS variables are accessible from other scripts within the HTML text...

08-21-2002, 12:28 PM
Do you mean... Making the variable Global?

08-22-2002, 02:34 AM
Ok, lets say i've got a variable in VBS (Myvar), and i want to display the content of that variable in the text string of a button for example! is this possible?

if i use:
<Param name = "text" Value = MyVar>
The button's text is the string of MyVar not the content.

Hope this explains my problem a bit better

08-22-2002, 04:41 AM
You have to do that via the script itself. You can access the page elements via the Document Object Model of the page, and alter their values. So.. give you element (the HTML Button) an ID attribute:

<INPUT TYPE="button" ID="my_button" VALUE="">


09-11-2002, 01:18 PM
If i'm understanding you correctly...

The best way to display a VB variable in html is:

<% language = "VBScript" %>

<% dim myvar %>
<% myvar = "hello" %>


<input type="button" value="<% response.write myvar %>"

(tested and works)

Make sure that u save the page with a .asp extension not .htm

The <% and %> tags are used to write a VBScript in HTML.

With this method, not only you can display variables but declare them, change them and perform every VBScript action.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum