Onkeydown event on a <asp:textbox>-how to display the value

Discussion in 'ASP .Net Web Controls' started by GP, Sep 17, 2004.

  1. GP

    GP Guest

    On the keydown event of a webcontrol in asp.net,I want to display the total
    number of characters typed in another text box,how do I do it?
    I have a text box web control,I want to check the length of the character on
    the key down event of the textbox control which is a client side validation.I
    am able to trap the keydown event the control displays an alert message "Key
    down fired".
    I am passing the control itself as parameter like
    onkeydown="chkMaxLength(this)")
    In the java script function
    function chkMaxLength(input)
    {
    var element;
    element=document.getElementById(input.name);
    alert(element.Value);
    }
    It always gives the error at document.getElementById(input.name),can some
    one help how to retreive the length and display it in another text box
    control.
    Thanks
    GP
     
    GP, Sep 17, 2004
    #1
    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. Tobias Åkeblom

    Capturing the onkeydown event i an IFRAME.

    Tobias Åkeblom, Sep 15, 2003, in forum: Javascript
    Replies:
    0
    Views:
    141
    Tobias Åkeblom
    Sep 15, 2003
  2. Matthew
    Replies:
    1
    Views:
    112
    Lasse Reichstein Nielsen
    Feb 10, 2004
  3. Replies:
    10
    Views:
    345
    Thomas 'PointedEars' Lahn
    Jun 6, 2005
  4. royend
    Replies:
    0
    Views:
    98
    royend
    Jun 22, 2007
  5. hzgt9b
    Replies:
    3
    Views:
    287
    David Mark
    Feb 14, 2008
Loading...

Share This Page