Show Tooltip or Invalid Icon on MaxLength?

2 posts, 0 answers
  1. Justavian
    Justavian avatar
    23 posts
    Member since:
    Aug 2010

    Posted 12 Aug 2012 Link to this post

    What's the best way to notify the user that they've arrived at the maximum length supported by a particular field?  Will i have to use a key up function and test the length, or is there some alternate method i might use?  It doesn't appear that there is anything built in - is there something i missed?

  2. Eyup
    Eyup avatar
    3320 posts

    Posted 15 Aug 2012 Link to this post

    Hello Rich,

    Please try the following approach:
    <telerik:RadTextBox ID="RadTextBox1" runat="server" MaxLength="2"
    function keyPressed(sender, args) {
        var currentText = sender.get_textBoxValue();
        setTimeout(checkText, 1, [currentText, sender.get_id()])
    function checkText(arguments) {
        var oldText = arguments[0];
        var newText = $find(arguments[1]).get_textBoxValue();
        if (oldText == newText) {
            alert("Max length reached");

    In addition, you could use a more user-friendly message form control instead of alert, for example RadWindow, RadTooltip, RadMenu, etc.

    I hope this will prove helpful.

    All the best,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top