How can show "abc" in textbox when click one botton

  • Thread starter msnews.microsoft.com
  • Start date
M

msnews.microsoft.com

Hello!
I'm Jim
by asp
How can show "abc" in textbox when click one botton?
 
B

Bob Barrows

msnews.microsoft.com said:
Hello!
I'm Jim
by asp
How can show "abc" in textbox when click one botton?

You can't. ASP is server-side technology.By the time a user can click a
button, ASP is no longer running.

You need to use client-side code for this. In the future, your client-side
coding questions should be asked in a more appropriate newsgroup. Look for
newsgroups with "dhtml" in their names.

It can be this simple:

<input type="text" id=myText>
<input type="button" onclick="myText.value='abc';">

HTH,
Bob Barrows
 
M

msnews.microsoft.com

Thank you!
but
I wrote this code:

Response.Write "<P><input type='test' id=test1></P>
Response.Write "<P><input type='button' onclick='test1.value='abc';'></P>

When my click the button,no reacting.
 
D

Don Verhagen

In msnews.microsoft.com <[email protected]> typed:
: Thank you!
: but
: I wrote this code:
:
: Response.Write "<P><input type='test' id=test1></P>
: Response.Write "<P><input type='button'
: onclick='test1.value='abc';'></P>
:
: When my click the button,no reacting.

Becuase you need to "nest" the quotes and double quotes. Your "version"
evaluates to:
test1.value=abc;

abc is never declared, I'm quite surprised the browser didn't generate an js
error (you may have them turned off with ie.

the onclick should be:
onclick = "test1.value='abc';"

Notice the double quotes.

Don Verhagen
 
R

Ray at

Next question? Excpected end of statement. ;]

When you response.write the " character, you have to double it (as one
option). IE.

<% response.write "<input name=""theName"" value=""theValue"">" %>

Ray at home
 
L

London

Thank you!
I'm sorry.I'm London,is the first contributor"msnews.microsoft.com".
I wrote this code:

Response.Write "<P><input type='button' onclick="text1.value="abc";"></P>"

But That is error (0x800A0401).
 
D

Don Verhagen

In London <[email protected]> typed:
: Thank you!
: I'm sorry.I'm London,is the first contributor"msnews.microsoft.com".
: I wrote this code:
:
: Response.Write "<P><input type='button'
: onclick="text1.value="abc";"></P>"
:
: But That is error (0x800A0401).

You're an idoit.

Response.Write("<P><input type='button'
onclick=""text1.value='abc';""></P>" )

=) Don
 
B

Baronesche Reutelteut

Don Verhagen said:
In London <[email protected]> typed:
: Thank you!
: I'm sorry.I'm London,is the first contributor"msnews.microsoft.com".
: I wrote this code:
:
: Response.Write "<P><input type='button'
: onclick="text1.value="abc";"></P>"
:
: But That is error (0x800A0401).

You're an idoit.

Response.Write("<P><input type='button'
onclick=""text1.value='abc';""></P>" )

=) Don

test
 

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,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top