R
Richard Gadsden
I've got a text box called txtMessage and a label called lblSize.
I've set txtMessage.MaxLength to 160 (yes, this is an SMS application) and
I want lblSize to show a countdown as the user types so they know how much
space they have left.
I've put a TextChanged event on txtMessage with:
lblSize.Text = 160 - txtMessage.Text.Length
and when you tab out of the txtMessage box, it counts down. But I want it
to count continuously as the user types.
What am I doing wrong, or is the whole approach wrong - would I need a
CustomValidator, or perhaps a completely client-side solution?
I've set txtMessage.MaxLength to 160 (yes, this is an SMS application) and
I want lblSize to show a countdown as the user types so they know how much
space they have left.
I've put a TextChanged event on txtMessage with:
lblSize.Text = 160 - txtMessage.Text.Length
and when you tab out of the txtMessage box, it counts down. But I want it
to count continuously as the user types.
What am I doing wrong, or is the whole approach wrong - would I need a
CustomValidator, or perhaps a completely client-side solution?