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

RadTextBox MaxLength Miss counted

9 Answers 300 Views
Input
This is a migrated thread and some comments may be shown as answers.
Jerry
Top achievements
Rank 1
Jerry asked on 10 May 2013, 09:17 AM
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?

9 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 15 May 2013, 08:44 AM
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.
0
Jerry
Top achievements
Rank 1
answered on 20 May 2013, 08:07 AM
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.
0
Eyup
Telerik team
answered on 23 May 2013, 02:52 PM
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.
0
Jerry
Top achievements
Rank 1
answered on 26 May 2013, 06:03 PM
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
0
Eyup
Telerik team
answered on 29 May 2013, 01:59 PM
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.
0
Jerry
Top achievements
Rank 1
answered on 30 May 2013, 01:58 AM
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.
0
Eyup
Telerik team
answered on 31 May 2013, 11:07 AM
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.
0
Craig Wallace
Top achievements
Rank 1
answered on 31 May 2013, 02:37 PM
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.  
0
Eyup
Telerik team
answered on 05 Jun 2013, 08:49 AM
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.
Tags
Input
Asked by
Jerry
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Jerry
Top achievements
Rank 1
Craig Wallace
Top achievements
Rank 1
Share this question
or