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

RadTextBox Multiline Maxlength issue back on latest version

19 Answers 363 Views
Input
This is a migrated thread and some comments may be shown as answers.
Philip
Top achievements
Rank 1
Philip asked on 10 Jul 2012, 07:38 PM
<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.

19 Answers, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 13 Jul 2012, 12:15 PM
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.
0
Lalu
Top achievements
Rank 1
answered on 04 Jun 2013, 07:32 AM
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
0
Vasil
Telerik team
answered on 05 Jun 2013, 10:10 AM
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.
0
Lalu
Top achievements
Rank 1
answered on 05 Jun 2013, 12:07 PM
Thanks for your reply
0
Lalu
Top achievements
Rank 1
answered on 14 Jun 2013, 09:57 AM
Hi,
can i set this prperty from server side dynamically.Please let me know this asap.
0
Vasil
Telerik team
answered on 14 Jun 2013, 12:13 PM
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.
0
Lalu
Top achievements
Rank 1
answered on 14 Jun 2013, 12:49 PM
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
0
Vasil
Telerik team
answered on 17 Jun 2013, 08:59 AM
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.
0
Franck
Top achievements
Rank 1
answered on 21 Aug 2013, 09:59 AM
Hi,

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

Regards,
0
Vasil
Telerik team
answered on 22 Aug 2013, 07:21 AM
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.
0
Dave
Top achievements
Rank 1
answered on 19 Nov 2013, 06:51 PM
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.


0
Vasil
Telerik team
answered on 22 Nov 2013, 12:27 PM
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.
0
collapse
Top achievements
Rank 1
answered on 17 Dec 2013, 09:27 AM
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
0
Vasil
Telerik team
answered on 18 Dec 2013, 08:34 AM
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.
0
collapse
Top achievements
Rank 1
answered on 18 Dec 2013, 09:46 AM
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,

0
Vasil
Telerik team
answered on 18 Dec 2013, 12:31 PM
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.
0
collapse
Top achievements
Rank 1
answered on 18 Dec 2013, 12:58 PM
yes I've tried but did not work
0
collapse
Top achievements
Rank 1
answered on 19 Dec 2013, 09:51 AM
with this trick,
ie11 is working properly, but also lower versions looks corrupted
0
Vasil
Telerik team
answered on 21 Dec 2013, 09:50 AM
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.
Tags
Input
Asked by
Philip
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Lalu
Top achievements
Rank 1
Franck
Top achievements
Rank 1
Dave
Top achievements
Rank 1
collapse
Top achievements
Rank 1
Share this question
or