Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Beginner Problem 1

Status
Not open for further replies.

grabrail

Technical User
Aug 15, 2001
269
0
0
GB
Im new to VBScript and I am playing with script in web pages.

I have a small section of code which utilises variables, sauch as name, address and phone number.

I use an inputbox to prompt for user input and the appropriate variable is filled with the data.

What I want to achieve is output of the variables to my web page without using msgbox.

Can anybody help me to achieve this
 
You could put a span, and then output the value to that:

<span id=theSpan name=theSpan></span>

then, the syntax for getting the value to show in between those two tags is:

theSpan.innerHTML = value

:)
Paul Prewett
penny.gif
penny.gif
 
How does this work and where do i put it, remember i am very new to vbscript, and dont fully understand it yet
 
<SPAN ID=&quot;my_span&quot;></SPAN>

It's just HTML code (that I didn't know, but useful!).
You can put it anywhere on your page, it's like a label I think, but it doesn't refer any control.


myspan.innerHTML = string

It's more JavaScipt than VBScript according to me.
I tested it with :

<HTML>
<HEAD>
<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
function WriteOnSpan()
{
my_span.innerHTML = &quot;After the test.&quot;;
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR=&quot;#FFFFFF&quot; TEXT=&quot;#000000&quot;>
<SPAN ID=&quot;my_span&quot;>Before the test.</SPAN><BR>
<BR>
<INPUT TYPE=&quot;button&quot; VALUE=&quot;test it!&quot;
OnClick=&quot;WriteOnSpan()&quot;>
</BODY>
</HTML>

I hopes it helps you.
--
X-) Split.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top