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

G

GP

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top