Try our conversational search powered by Generative AI!

Char limit on XHTML string?

Vote:
 
I want to set a limit on the amount of text a user can enter in the editor. Can anyone tell me to accomplish this? Is there something simple that I'm overlooking or will I have to create my own custom property. If so, are there any code examples that use the WYSIWYG editor?
#13399
Mar 25, 2008 11:22
Vote:
 
Ok, I've discovered the HtmlEditor.Maxlength property. However this doesn't seem to do anything. I.e. if I set max length to 200 I can still enter as much text as I want and nothing whatsoever happens.
#19105
Mar 25, 2008 15:51
Vote:
 

Hi Martin, did you ever find a solution for this, I am facing the same issue?

 

Cheers

Chris

#35050
Nov 25, 2009 13:49
Vote:
 

Hi!

As you said, the MaxLength property does not seem to do anything but I've written an example of a custom property that validates the length according to a given max length server side:

http://world.episerver.com/Templates/Forum/Pages/Thread.aspx?id=33667&epslanguage=en

Linus Ekström
EPiServer Development Team

#35071
Nov 27, 2009 10:04
Vote:
 

Thanks Linus,

I did end up using the ApplyEditChanges method in the end, which works well for my requirements at the moment, I did read that in CMS 6 there will be the option to set "settings" on custom properties, ideally what i'd like is to have one custom property, with a setting which can be set for the max length. I can then have multiple properties on a page type, all with different max lengths, are you aware of this in CMS 6?

Regards

Chris

#35073
Nov 27, 2009 11:01
Vote:
 

Hi!

It's possible to define different settings for the different properties on your page type or you could even define a couple of global property settings and just use the setting you want for the properties on your different page types. This way you only have to do a change in one place if you decide to change the length for one of your property settings even if this is used on multiple page types. See this blog entry for more details regarding property settings:

http://labs.episerver.com/en/Blogs/Linus-Ekstrom1/Dates/2009/10/Settings-for-properties/

Regards
Linus Ekström

#35078
Nov 27, 2009 11:21
Vote:
 

excellent, just what I am looking for, thanks for you help!

#35079
Nov 27, 2009 11:39
Vote:
 

I dunno if this is still an issue but i found this to be very helpful when trying to do something similar

http://world.episerver.com/Blogs/Alexander-Haneng/Dates/2012/7/How-to-define-properties-in-EPiServer-7---A-quick-reference/

#91454
Edited, Oct 06, 2014 12:57
Vote:
 
#91455
Oct 06, 2014 13:00
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.