Changing the Value of Label

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mathewgk80
    New Member
    • Sep 2007
    • 103

    Changing the Value of Label

    Hi all,

    I am trying to do an assignment.

    I have a textbox. The size of the textbox is 20;

    I have a label. The text of the label is 20 by default.

    When i enter a letter say 'a' into the value of the label should be changed to 19.

    Likewise, how many letters i enter into the text box, the value of the label should be decreased..

    I need a keypress event that is when a key is pressed on the keyboard,the value of label should be decreased.

    I am using asp.net, c#.net and Javascrpt.
    Please help me...

    Thanks.

    Mathew.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by mathewgk80
    Hi all,

    I am trying to do an assignment.

    I have a textbox. The size of the textbox is 20;

    I have a label. The text of the label is 20 by default.

    When i enter a letter say 'a' into the value of the label should be changed to 19.

    Likewise, how many letters i enter into the text box, the value of the label should be decreased..

    I need a keypress event that is when a key is pressed on the keyboard,the value of label should be decreased.

    I am using asp.net, c#.net and Javascrpt.
    Please help me...

    Thanks.

    Mathew.
    And what do you have so far?

    Comment

    • mathewgk80
      New Member
      • Sep 2007
      • 103

      #3
      Originally posted by r035198x
      And what do you have so far?
      I dont know how to do it. please help me

      thanks

      Mathew

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        Originally posted by mathewgk80
        Hi all,

        I am trying to do an assignment.

        I have a textbox. The size of the textbox is 20;

        I have a label. The text of the label is 20 by default.

        When i enter a letter say 'a' into the value of the label should be changed to 19.

        Likewise, how many letters i enter into the text box, the value of the label should be decreased..

        I need a keypress event that is when a key is pressed on the keyboard,the value of label should be decreased.

        I am using asp.net, c#.net and Javascrpt.
        Please help me...

        Thanks.

        Mathew.
        Check out the .NET article on how to check if a TextBox contains a number...this will give you an idea of how to use JavaScript to do this for you.

        Cheers!

        -Frinny

        Comment

        Working...