Textareas do not have a property to limit the maximum length of their content like textboxes. The easiest way to set a maximum length on their content is to set the
validate property of the textarea to:
^[\S\s]{0,70}$
Change 70 to the maximum number of characters which you want to allow. Then, set the
validation error message property to a message like:
Cannot be longer than 70 characters
To warn the user, instead of setting a hard limit on the amount of content allowed in a textarea, add JavaScript code to the DynaForm to use the
setOnchange() method to check the length of the value in the textarea and
window.dynform.flashMessage to display a warning message to the user:
Code: Select all$("#specialOrder").setOnchange(function (newVal, oldVal) {
if (newVal.length > 70)
window.dynaform.flashMessage( {
emphasisMessage: "Please limit to a maximum of 70 characters.",
message: " ",
duration: 4000,
type: 'info',
appendTo: $('#specialOrder')
} )
} );
Where "specialOrder" is the ID of your textarea.