Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > How can show "abc" in textbox when click one botton

Reply
Thread Tools

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

 
 
msnews.microsoft.com
Guest
Posts: n/a
 
      10-02-2003
Hello!
I'm Jim
by asp
How can show "abc" in textbox when click one botton?

 
Reply With Quote
 
 
 
 
Bob Barrows
Guest
Posts: n/a
 
      10-02-2003
msnews.microsoft.com wrote:
> 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


 
Reply With Quote
 
 
 
 
msnews.microsoft.com
Guest
Posts: n/a
 
      10-02-2003
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.

 
Reply With Quote
 
Don Verhagen
Guest
Posts: n/a
 
      10-02-2003
In news:%,
msnews.microsoft.com <> 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



 
Reply With Quote
 
Ray at
Guest
Posts: n/a
 
      10-02-2003
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

"Don Verhagen" <> wrote in message
news:blg4nt$bpu28$...
> In news:%,
> msnews.microsoft.com <> 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
>
>
>



 
Reply With Quote
 
London
Guest
Posts: n/a
 
      10-02-2003
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).

 
Reply With Quote
 
Bullschmidt
Guest
Posts: n/a
 
      10-02-2003
Unless you planned on reloading the page with that info, you'd probably
want to use JavaScript and here is a good board for that:

http://www.codingforums.com/forumdis...p?s=&forumid=2

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
Don Verhagen
Guest
Posts: n/a
 
      10-02-2003
In news:,
London <> 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




 
Reply With Quote
 
Baronesche Reutelteut
Guest
Posts: n/a
 
      10-02-2003
"Don Verhagen" <> wrote in message news:<blgg1j$c190b$>...
> In news:,
> London <> 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
--


 
Reply With Quote
 
Ray at
Guest
Posts: n/a
 
      10-02-2003
What is an idoit?

Ray at work

"Don Verhagen" <> wrote in message
news:blgg1j$c190b$->
> You're an idoit.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Print Picture on Botton of 8 by 11 page flamestar Computer Support 38 12-07-2006 09:16 AM
How to get right mouse botton click on image Dustin Carroll Javascript 3 05-20-2006 06:00 PM
Text Area that opens a txt file with a click of a botton xtheriaultx@gmail.com Javascript 7 11-07-2005 04:18 PM
Box around RadioList Botton Celebrate ASP .Net 0 08-22-2003 08:22 PM



Advertisments
 



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 47 48 49 50 51 52 53 54 55 56 57