Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
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.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Mixing variables in HTML

Reply
 
Old 11-07-2008   #1 (permalink)
Andy


 
 

Mixing variables in HTML

Hi there.

Does anyone know how you can get vbscript/HTA to display variables outside
of the <script></script>?

For example, I define a variable in the <script></script> that needs to be
displayed in the body of the page.

i've tried doing <%=var %> <% echo(var) %> and any number of things which no
effect. Does anyone have any clue?

Thanks in advance.

Andy


My System SpecsSystem Spec
Old 11-07-2008   #2 (permalink)
mr_unreliable


 
 

Re: Mixing variables in HTML

Andy wrote:
Quote:

> Does anyone know how you can get vbscript/HTA to display variables
> outside of the <script></script>?
>
Andy, there must be a hundred ways to do this.

here are a couple:

If using a text box (er sorry, the input tag), you could
set the value parameter.

oDoc.getElementById("myTxtBox").value = "hi there"

If using a "block" tag (such as <p>), you could use the
dhtml "innerText" method.

oDoc.getElementById("myPar").innerText = "vbs rocks"

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but, no guarantee
the answers will be applicable to the questions)
My System SpecsSystem Spec
Old 11-07-2008   #3 (permalink)
Andy


 
 

Re: Mixing variables in HTML

Sorry, I should've mentioned that this is how i'm getting the data i need to
print:

Set diskSet =
GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery("Select
Size, Index From Win32_DiskDrive where Index = 0")

thanks,
andy
"mr_unreliable" <kindlyReplyToNewsgroup@xxxxxx> wrote in message
news:eAE$X9PQJHA.764@xxxxxx
Quote:

> Andy wrote:
Quote:

>> Does anyone know how you can get vbscript/HTA to display variables
>> outside of the <script></script>?
>>
>
> Andy, there must be a hundred ways to do this.
>
> here are a couple:
>
> If using a text box (er sorry, the input tag), you could
> set the value parameter.
>
> oDoc.getElementById("myTxtBox").value = "hi there"
>
> If using a "block" tag (such as <p>), you could use the
> dhtml "innerText" method.
>
> oDoc.getElementById("myPar").innerText = "vbs rocks"
>
> cheers, jw
> ____________________________________________________________
>
> You got questions? WE GOT ANSWERS!!! ..(but, no guarantee
> the answers will be applicable to the questions)
My System SpecsSystem Spec
Old 11-07-2008   #4 (permalink)
mayayana


 
 

Re: Mixing variables in HTML

It doesn't matter where you're getting the
info. for the variable. You just have to use
some method of the IE DOM, as mr_unreliable
demonstrated, rather than using ASP code.
You can assign the value to the innerText,
value, etc. of any HTML element.
Quote:

> Sorry, I should've mentioned that this is how i'm getting the data i need
to
Quote:

> print:
>
> Set diskSet =
> GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery("Select
> Size, Index From Win32_DiskDrive where Index = 0")
>


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
math with "GB/MB/KB" in variables fails, without variables works? PowerShell
working on html objects using HTML DOM, VBscript VB Script
Mixing error? Vista music pictures video


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46