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

Discussion in 'ASP General' started by msnews.microsoft.com, Oct 2, 2003.

  1. Hello!
    I'm Jim
    by asp
    How can show "abc" in textbox when click one botton?
     
    msnews.microsoft.com, Oct 2, 2003
    #1
    1. Advertising

  2. msnews.microsoft.com

    Bob Barrows Guest

    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
     
    Bob Barrows, Oct 2, 2003
    #2
    1. Advertising

  3. 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.
     
    msnews.microsoft.com, Oct 2, 2003
    #3
  4. msnews.microsoft.com

    Don Verhagen Guest

    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
     
    Don Verhagen, Oct 2, 2003
    #4
  5. msnews.microsoft.com

    Ray at Guest

    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$-berlin.de...
    > 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
    >
    >
    >
     
    Ray at, Oct 2, 2003
    #5
  6. msnews.microsoft.com

    London Guest

    Re: How can show "abc" in textbox when click one button

    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).
     
    London, Oct 2, 2003
    #6
  7. msnews.microsoft.com

    Bullschmidt Guest

    Bullschmidt, Oct 2, 2003
    #7
  8. msnews.microsoft.com

    Don Verhagen Guest

    Re: How can show "abc" in textbox when click one button

    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
     
    Don Verhagen, Oct 2, 2003
    #8
  9. Re: How can show "abc" in textbox when click one button

    "Don Verhagen" <> wrote in message news:<blgg1j$c190b$-berlin.de>...
    > 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
    --

     
    Baronesche Reutelteut, Oct 2, 2003
    #9
  10. msnews.microsoft.com

    Ray at Guest

    Re: How can show "abc" in textbox when click one button

    What is an idoit?

    Ray at work

    "Don Verhagen" <> wrote in message
    news:blgg1j$c190b$->
    > You're an idoit.
     
    Ray at, Oct 2, 2003
    #10
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jiong Feng
    Replies:
    0
    Views:
    931
    Jiong Feng
    Nov 19, 2003
  2. Bruce Sam
    Replies:
    15
    Views:
    8,064
    John C. Bollinger
    Nov 19, 2004
  3. vsgdp

    ABC inheriting from ABC

    vsgdp, Sep 24, 2005, in forum: C++
    Replies:
    1
    Views:
    326
    vsgdp
    Sep 24, 2005
  4. Gunter Henriksen

    x.abc vs x['abc']

    Gunter Henriksen, May 13, 2009, in forum: Python
    Replies:
    1
    Views:
    377
    alex23
    May 15, 2009
  5. Replies:
    4
    Views:
    170
Loading...

Share This Page