Question

Limit Input Length for Text Area

Hi All, How can we restrict the length of data entered by a user for a field displayed as text area. For Example: A field in database is 300 char long; providing a textbox is not a good option hera as the content may be more instead we can provide a textarea but we need to limit the numbers of characters entered as it might fail while saving if length is more than 300. Please provide your suggestions.

***Updated by moderator: Lochan to mark this as a question***

***Updated by moderator: Lochan to close post***
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

March 28, 2011 - 7:33am

You should be able to use the function @length in the post activity to call a Property-Set-Messages error if the length of the property is greater than what you want it to be.

May 10, 2011 - 7:43am

Hi,

i think you can give the Max lenght in the Property itself. instead of tracking them in Activity.

thanks
Veera

May 11, 2011 - 1:29am

Hi, you can do it at section level, on control you can define min/max character for your text area.

regards
sharad

May 11, 2011 - 1:39am

Guys,

Not a big deal here. I agree with Veera...When you taken the textarea in section you need to apply the property for it right???

In that property, we can specify the limit in the options of Maximum Length and Expected lenghts...We can do it with in property itself.

Thanks,
Jayavardhan.T

September 30, 2016 - 10:49am
Response to SHARAD1084-1

But there is no min/max character option available for text area in Pega 6.2.Since I am using a button which dont have a Submit action to perform,so Pega is not able to handle the MaxLength option in the advanced tab of that specific property itself.Please let me know if there are any other ways to handle this.

January 7, 2013 - 9:07am

Thanks that really helped

Regards,

Aileen

 

October 2, 2016 - 1:16am

You can create a validate or edit validate rule and stop the user in committing to DB

October 3, 2016 - 6:30am
Response to DharanitharanR

Hello Dharani,

I have to use this on a modal diaglogue box.On this I have a button (which do not have Submit action).On click of this button it should throw an error and persists that on the modal dialogue.But in my case,after the user has exceeded the limit,it throws error but in addition to that the dialogue box is also closed which should not be.The box should only be closed once we have the correct limit in the text area.Please suggest ways on this.

October 9, 2016 - 12:50am

Then instead of flowaction Validate on click of that  button you can create an activity to call the validate rule or you can use property-set-messages or page-set-messages

October 9, 2016 - 12:50am

In activity use Obj-Validate method