RadTextBox Multiline Maxlength issue back on latest version

20 posts, 0 answers
  1. Philip
    Philip avatar
    21 posts
    Member since:
    Nov 2008

    Posted 10 Jul 2012 Link to this post

    <telerik:RadTextBox ID="txtTest" runat="server" TextMode="MultiLine" Width="99%" Height="200px"
      MaxLength="1000" Skin="Windows7">
      <ClientEvents OnValueChanged="RegExpCheck" OnValueChanging="RegExpCheck" OnKeyPress="kp" />
    </telerik:RadTextBox>

    We previously have code using the RadTextBox on multi-line and limiting user input to 1000 characters. This has been working on version 2011.2.712.40. However we got a couple of users complaining that the field gets 'slow' when accepting user input. Users are using IE browser version 7/ 8. Those using IE 9 are fine. Upon testing with the latest version (2012.2.607.40), the 'slowness' issue got resolved, however, the maxlength value is now being ignored.

    Please review and let me know if there is a fix for this. Thanks.
  2. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 13 Jul 2012 Link to this post

    Hello Philip,

    In 2012.2.607 version there was a bug with the max length, and we fixed it a bit later. So I tested the code without the client events, since I don't have their code:
    <telerik:RadTextBox ID="txtTest" runat="server" TextMode="MultiLine" Width="99%"
        Height="200px" MaxLength="1000" Skin="Windows7">
        <ClientEvents />
    </telerik:RadTextBox>
    And and the max length is working correct with the 2012.2.710 version. Update your project and please confirm that there is no some JavaScript error in the handlers that prevents JS to execute correctly.

    Kind regards,
    Vasil
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Lalu
    Lalu avatar
    9 posts
    Member since:
    Jun 2012

    Posted 04 Jun 2013 Link to this post

    Hi,
    Multiline textbox with maximum length is working in latest version of telerik but i have occurred a problem.Set maximum length in multiline textbox as 10  and enter the text as below

    aaa
    bbb
    cc

    after entering value check length of the textbox text ,It shows 12.This problem occurs in Mozilla and in IE.But it is working fine in chrome.Please review and let me know if there is a fix for this.
    Thanks
    Shibin
  5. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 05 Jun 2013 Link to this post

    Hi Lalu,

    Different browsers count new line as one or two characters "\n" or "\r\n". Since there is no MaxLenght standard for textarea, we could not do solution that to be consistent in each browsers. We count the new line as 1 character. By default, you can override the _escapeNewLineChars using this code if you like to count them as 2 chars.
    Telerik.Web.UI.RadInputControl.prototype._escapeNewLineChars_org = Telerik.Web.UI.RadInputControl.prototype._escapeNewLineChars;
    Telerik.Web.UI.RadInputControl.prototype._escapeNewLineChars = function (text, replaceWith)
    {
     return this._escapeNewLineChars_org(text, "  ");
    }


    Regards,
    Vasil
    Telerik
    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.
  6. Lalu
    Lalu avatar
    9 posts
    Member since:
    Jun 2012

    Posted 05 Jun 2013 Link to this post

    Thanks for your reply
  7. Lalu
    Lalu avatar
    9 posts
    Member since:
    Jun 2012

    Posted 14 Jun 2013 Link to this post

    Hi,
    can i set this prperty from server side dynamically.Please let me know this asap.
  8. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 14 Jun 2013 Link to this post

    Hello Lalu,

    You can not apply it server side. It is client side approach because it affects the JavaScript that is running in the browser to validate the text lengthl

    Regards,
    Vasil
    Telerik
    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 the blog feed now.
  9. Lalu
    Lalu avatar
    9 posts
    Member since:
    Jun 2012

    Posted 14 Jun 2013 Link to this post

    I have a custom control of multiline text box.That control is used in all forms.To place the script in custom control is not possible.Because that script needs radcode block.Any other way to use this script to set enter key character as 2 in script.
    Thanks
    shibin
  10. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 17 Jun 2013 Link to this post

    Hello Lalu,

    There are some other options:
    • Use the latest version.
    • Modify the original code and compile the controls. (No sue about your license, and if you have the code) .
    • Disable the embedded resources, and include changed with the fix resources. (You will not able to use the CDN)
    • Place the script in your master page. (add check if Telerik.Web.UI.RadInputControl.prototype is not a null, to avoid exception when there is no RadInput control in your page)

    Regards,
    Vasil
    Telerik
    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 the blog feed now.
  11. Franck
    Franck avatar
    1 posts
    Member since:
    Aug 2010

    Posted 21 Aug 2013 Link to this post

    Hi,

    This solution works when you type text but not when pasting
    Any idea to solve the pb ?

    Regards,
  12. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 22 Aug 2013 Link to this post

    Hello Franck,

    Test with the latest internal build. We did some fixes for this issue. Per my tests it work correct during paste as well as typing and drag-drop. If you have any problems, let us know, so we can correct it the next release.

    Regards,
    Vasil
    Telerik
    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 the blog feed now.
  13. Dave
    Dave avatar
    12 posts
    Member since:
    Jun 2012

    Posted 19 Nov 2013 Link to this post

    Testing multiline RadTextBox set to 1000 characters, and if I paste in a block of text, keep hitting CTRL-V, I can paste as much as I want.  IE 8.  The MaxLength doesn't seem to work.....I guess I'll have to truncate it to avoid a DB error.


  14. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 22 Nov 2013 Link to this post

    Hi Dave,

    I tested this in the latest version of our control, here in our demos. I would suggest you to upgrade if you are using old version of the controls.
    Please note that this is still only client side validation and it is possible for user to turn off the JS and baypass the max length limit of textarea. So you should do server side validation in any case.

    Regards,
    Vasil
    Telerik
    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 the blog feed now.
  15. collapse
    collapse avatar
    7 posts
    Member since:
    May 2012

    Posted 17 Dec 2013 Link to this post

    Hi 
    this demo page i have an issue, in IE you try press enter key in multiline textbox not working correctly.
    i can't pass the new line. Only i have a whitespace.  

    i'm using Telerik.Web.UI 2013.3.1114.40
  16. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 18 Dec 2013 Link to this post

    Hello collapse,

    See this thread for solution:
    http://www.telerik.com/community/forums/aspnet-ajax/input/radtextbox-multiline-ie11.aspx

    Regards,
    Vasil
    Telerik
    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 the blog feed now.
  17. collapse
    collapse avatar
    7 posts
    Member since:
    May 2012

    Posted 18 Dec 2013 Link to this post

    hi Vasil,

    what is said in these pages(ie11 problem) did not work for me,
     actually my problem in this forum(multiline issue.)  and in all versions of this problem not only in ie11

    thanks,

  18. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 18 Dec 2013 Link to this post

    Hi,

    Did you tried this approach disused in the bottom of the thread:
    .RadInput textarea { white-space: pre !important; }

    Regards,
    Vasil
    Telerik
    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 the blog feed now.
  19. collapse
    collapse avatar
    7 posts
    Member since:
    May 2012

    Posted 18 Dec 2013 Link to this post

    yes I've tried but did not work
  20. collapse
    collapse avatar
    7 posts
    Member since:
    May 2012

    Posted 19 Dec 2013 Link to this post

    with this trick,
    ie11 is working properly, but also lower versions looks corrupted
  21. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 21 Dec 2013 Link to this post

    Hi,

    You could download the latest internal build, where the issue is already fixed. If you want, you could use this workaround:
    span.RadInput textarea { white-space: pre-wrap; }


    Regards,
    Vasil
    Telerik
    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 the blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017