/o//commerce-media/accounts/-1/images/18473350?download=true

Set Max Char to Content
Icon
DXP App
18472990
In most of the cases, web contents are created with the help of structure and template. While creating web content with structure and template, we can't restrict user to enter data with specific length. In other word, out of the box, there is no such facility to restrict user to enter predefined number of characters for structure element. This app facilitate this feature.

This app is comprises of one hook. After deploying this app, if we want to restrict user to add specific length of data then we need to set number of allowed characters in meta data (called 'noOfCharacterAllowed') of structur's element.

For example, let say there is one element in structure called 'component' and we want to set number of allowed characters to 100, then defined it in meta data as below

<dynamic-element name="component" type="text" index-type="" repeatable="false">
<meta-data>
<entry name="noOfCharacterAllowed"><![CDATA[100]]></entry>
</meta-data>
</dynamic-element>

After defining number of allowed character in meta data, label like "Maximum 100 Characters are allowed" will be visible after each such element on web content creation screen. When user tries to save / publish web content, JS error message will be displayed for each such element where user had entered more than allowed characters.

This way we can restrict number of allowed character dynamically and it is configurable through meta data.
Currently this feature is available to following types of elements

1. Text
2. Text-Box
3. Tex-Area(HTML)

For element of type Text-Area(HTML), the data will be stored in form of HTML. The No of character will be counted after filtering all html tags by this element, so it will count no of character which is actually entered by user.
DEVELOPER
Nilang I Patel
DEVELOPER
9/15/14 12:00 AM
Published date
September 15, 2014
Published Date
9/15/14 12:00 AM
SUPPORTED OFFERINGS
Self-Hosted, Self-Managed
Supported Versions
6.1
Resource Requirements
Edition
CE, EE
PRICE
Free
help & support
Terms & Conditions
SHARE LINK
Copy & Share Link

HTML Example

A paragraph is a self-contained unit of a discourse in writing dealing with a particular point or idea. Paragraphs are usually an expected part of formal writing, used to organize longer prose.