This is a migrated thread and some comments may be shown as answers.

Find the RadTextbox Length

1 Answer 308 Views
Input
This is a migrated thread and some comments may be shown as answers.
Vvamc
Top achievements
Rank 1
Vvamc asked on 19 Jun 2014, 03:06 PM
Hi 

I have radtextbox I need to find the length of the characters  entered  on each entry of a letter in rad textbox ? I am not able to understand which client event to be fired as i have tried onKey press but none of the events are firing.Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 20 Jun 2014, 03:17 AM
Hi Vvamc,

Try to use onkeyup event to count the number of entered character in the RadTextBox. This event will fire when the key is released. Please take a look into the below sample code snippet to achieve your scenario.

ASPX:
<telerik:RadTextBox ID="rtxtCharacterLength" runat="server" onkeyup="return checkLength(this);">
</telerik:RadTextBox>

JavaScript:
function checkLength(txt) {
    var txtLength;
    if (txt != null) {
        var txtLength;= txt.value.length
        alert(txtLength;);
    }
}

Thanks,
Shinu.
Tags
Input
Asked by
Vvamc
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or