RadTextBox MaxLength Miss counted

10 posts, 0 answers
  1. Jerry
    Jerry avatar
    4 posts
    Member since:
    May 2013

    Posted 10 May 2013 Link to this post

    I am currently using Telerik RadControls for ASP.net Ajax Version 2012.3.1308.45,
    When I set a MaxLength for RadTextBox to 255, everything works correctly except when Copy and Paste text or using mouse right click to paste text into the RadTextBox, it allow the line break '\n\r'  to bypass the MaxLength count.
    Somehow from runtime value, I check and compare the length is more than the MaxLength.
    This senarios happens in all sorts of browser (FF, IE, Chrome) and even in the Demo site,
    I don't understand if this is the correct behaviour or bugs based on the calculation logic.

    I would need to include the count for line break '\n\r' as well else it will hit SQL length limit to cause insert or edit error.
    What else can I do to cater this?
  2. Eyup
    Admin
    Eyup avatar
    3009 posts

    Posted 15 May 2013 Link to this post

    Hello Jerry,

    I am afraid we are not able to replicate the issue locally. Can you replicate this behavior with any of our demos?
    http://demos.telerik.com/aspnet-ajax/input/examples/radtextbox/firstlook/defaultcs.aspx

    Please provide us the exact steps to reproduce the issue or open a support ticket to send us a sample runnable application demonstrating the erratic behavior. Thus, we will be able to further analyze the problem and provide a proper solution.

    All the best,
    Eyup
    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. Jerry
    Jerry avatar
    4 posts
    Member since:
    May 2013

    Posted 20 May 2013 Link to this post

    Text copied from a random wikipedia page with next line or new line will cause the radtextbox to exceed the maximum from MaxLength set in code behind, please refer to the screenshot I attached as the runtime value for the radTextBox.

    So is this a bug or logical problem? The Demo link you provide also having the same behaviour.
  5. Eyup
    Admin
    Eyup avatar
    3009 posts

    Posted 23 May 2013 Link to this post

    Hello Jerry,

    I have prepared a sample web site to test the described behavior. On my side the MaxLength correctly limits the text content to length of 255. Please run the attached application and verify that it works as expected from your end, too.

    Regards,
    Eyup
    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. Jerry
    Jerry avatar
    4 posts
    Member since:
    May 2013

    Posted 26 May 2013 Link to this post

    Dear Eyup,

    I tested the sample you provide, and the problem I mention still happens, the steps to reproduce the problem will be go to a Wikipedia page and use your mouse right click to copy the text from website after that right click and paste the text into the radtextbox.

    Please refer to the screenshot I attached for you to easier reproduce the problem.

    Thanks
  7. Eyup
    Admin
    Eyup avatar
    3009 posts

    Posted 29 May 2013 Link to this post

    Hi Jerry,

    Can you share whether you are using older version of RadControls? There was an issue with the new line
    characters which was already fixed:
    http://www.telerik.com/products/aspnet-ajax/whats-new/release-history/q3-2012-version-2012-3-1016-39868178.aspx#input

    Please upgrade to the latest release version of the controls and let us know if the issue still remains.

    Regards,
    Eyup
    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.
  8. Jerry
    Jerry avatar
    4 posts
    Member since:
    May 2013

    Posted 29 May 2013 Link to this post

    I am currently using Telerik RadControls for ASP.net Ajax Version  2012.3.1308.45
    The bug fixed list you provided version 2012.3.1016 appears to be earlier version compare to the version I currently use.
  9. Eyup
    Admin
    Eyup avatar
    3009 posts

    Posted 31 May 2013 Link to this post

    Hi Jerry,

    I was able to reproduce the issue with FireFox. Please note that this behavior is browser specific, not Telerik related. You can reproduce the issue with a standard textarea element, too:
    <textarea id="textareaID" runat="server" maxlength="255"></textarea>

    You will need to trim or replace the empty rows before updating your database.
    I hope the clarification was helpful.

    Regards,
    Eyup
    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.
  10. Craig Wallace
    Craig Wallace avatar
    118 posts
    Member since:
    Jan 2005

    Posted 31 May 2013 Link to this post

    Hi Eyup,

    I am here as I have discovered the same problem with RadTextBox in Chrome. If I copy and paste text into the RadTextBox, it will easily allow more than the MaxLength setting on the control.  

    Your example of Maxlength on a textarea is something that is only very recently supported by any browser, and I would not use it as a example to justify why RadTextBox is allowing too many characters.

    I submit that this is a bug that needs to be fixed.  The whole point in using RadControls is that they are supposed to be better than raw HTML or even ASP.Net, and better for working with databases.  
  11. Eyup
    Admin
    Eyup avatar
    3009 posts

    Posted 05 Jun 2013 Link to this post

    Hi Craig,

    I understand your point and generally, you are right, however, this behavior is too complicated through the different Operation Systems, browsers, cultures, etc. Basically, the problem is that there is no defined standard which we can follow - in some configurations the new row char count is 1 and in others - is 2 characters. The chosen behavior can be appropriate to some users, and can damage the logic of others.

    Nevertheless, you can log your requirement as a feature request so our developers will consider including it for the future releases:
    http://www.telerik.com/feedback/ajax

    Regards,
    Eyup
    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017