dynamically add text to label as user inputs to textbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • abehm
    New Member
    • May 2007
    • 35

    dynamically add text to label as user inputs to textbox

    Hey all,
    I'm fairly new to javascript and i need to write some code into my webpage that will automatically post text from a textbox as user types it, into a label. Could someone please help me? Thanks.
    Aaron
  • epots9
    Recognized Expert Top Contributor
    • May 2007
    • 1352

    #2
    Please post some html/javascript code that u've made so far. we ask that u please attempt it yourself first because we do not do the work for others.

    thank you

    Comment

    • abehm
      New Member
      • May 2007
      • 35

      #3
      Originally posted by epots9
      Please post some html/javascript code that u've made so far. we ask that u please attempt it yourself first because we do not do the work for others.

      thank you
      well that's the thing I can do it with c# behind my asp page. but it will only copy the text on postback.

      basically:

      Label1.Text = Text1.Text;

      but as the user types it.
      Is there a way javascript can kind of merge the two controls so that if one thing is entered into the textbox, it is also entered into the label?

      Comment

      • epots9
        Recognized Expert Top Contributor
        • May 2007
        • 1352

        #4
        Originally posted by abehm
        well that's the thing I can do it with c# behind my asp page. but it will only copy the text on postback.

        basically:

        Label1.Text = Text1.Text;

        but as the user types it.
        Is there a way javascript can kind of merge the two controls so that if one thing is entered into the textbox, it is also entered into the label?
        for the textbox use the onkeydown event to copy the contents of the textbox to the label

        Comment

        Working...