How can textbox in server-side shows client-side's value

J

Jack

Hello,
I wrote this code:
<FORM name=form2 id=1>
<SCRIPT Language=VBScript>
dim ab
ab=10
</SCRIPT>
<SCRIPT Language=VBScript RUNAT=Server>
Response.Write "<INPUT type=""text"" id=text2 name=text2 value=" & ab & ">"
'I think this procedure has problem
Response.Write "<BR>"
Response.Write "<INPUT type=""button"" value=""Button2"" id=button2
onclick=""text2.value=ab"">"
</SCRIPT>
</FORM>

When open this form,text2 doesn't show ab's value.But click button2,text2
show ab's value.
I want when open this form text2 shows ab's value
Can you help me
 
R

Ray at

ab is a client-side variable. The server will not know what ab is. Throw
in an Option Explicit, and you'll see that it's just an undeclared variable.

Ray at home
 
P

Phillip Windell

Ray,

I sent you a message with a "private" question in it that is somewhat
related to this. I just wanted to let you know in case you didn't
check your personal email for a while.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top