473,386 Members | 1,796 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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

Jul 19 '05 #1
4 4007
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

"Jack" <si*****************@yahoo.co.jp> wrote in message
news:uZ**************@TK2MSFTNGP09.phx.gbl...
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

Jul 19 '05 #2
Thank you

Jul 19 '05 #3
Jack, please do not multipost. Remember a few weeks back?

Ray at work

"Jack" <si*****************@yahoo.co.jp> wrote in message
news:uZ**************@TK2MSFTNGP09.phx.gbl...
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

Jul 19 '05 #4
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.
--

Phillip Windell [CCNA, MVP, MCP]
WAND-TV (ABC Affiliate)
www.wandtv.com

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in
message news:O8**************@TK2MSFTNGP11.phx.gbl...
Jack, please do not multipost. Remember a few weeks back?

Ray at work

"Jack" <si*****************@yahoo.co.jp> wrote in message
news:uZ**************@TK2MSFTNGP09.phx.gbl...
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


Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Rodrigo DeJuana | last post by:
Howdy, I'm new to this .net stuff and really have little to no training. Im trying to create a new page for a web form, so i have been pretty much jsut coping code. I having some issue with...
1
by: Jerry J | last post by:
I am using page level exceptions on some of my WebForms. In most cases I am handling the errors simply like this: Private Sub Page_Error(ByVal sender As Object, ByVal e As System.EventArgs)...
0
by: Luis Esteban Valencia | last post by:
am trying to databind within an asp:textbox control. I have tried many variations found here but nothing seems to work. It works fine if I use a regular HTML textbox input though. Here is what I...
5
by: hanolo | last post by:
Does anyone ever see this happen. I build a form with couple of textbox server control. When user inputs character ` in there, after form post back, the textbox become a line of string such as...
0
by: mamun | last post by:
Hi All, I have the following situation. I have 10 rows in a form. In each row there are six textbox controls. The users can enter any number of rows of records (either none or upto 10). I...
0
by: sjickells | last post by:
Hi I am having a problem using asp:TextBox's in a transparent table. I have a background image on the page and a table in the middle of the page. I have set the background colour of the table...
2
by: Nathan Sokalski | last post by:
I have a multiline TextBox that I want to display the text used to create a control in an apsx file. I want each of these to be on a separate line in the TextBox. The only way I know of to place...
1
by: Kageoni2 | last post by:
I'm trying to add new records to my database using 4 textboxes, one for each field in my databases table. I've got ID, Firstname, Surname and Course. But I can't figure out at all how to link...
0
KalariaNitya
by: KalariaNitya | last post by:
Hello, could anybody help me? i have gridview, inside gridview i have one Update button & textbox update button update the quantity entered in textbox. i want to update the quantity on textbox on...
4
by: MissElegant | last post by:
Hi all, I have tried to do a test to a lesson which was in the internet, but it doesn't work? ANYBody here to help please?? The problem that what I enter in the textbox should be sent to the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.