Count Characters in a Multi-line field

  • 9 November 2020
  • 3 replies
  • 56 views

Badge +1

I'm trying to work out how to count the number of characters in a multi-line textbox in real time, as I have a requirement for the field to have a minimum of 200 characters.  I've searched the form and found a post that counts down from 10 characters, but can't seem to get this to work on my multi-line textbox.

 

Can someone please advise how to get this working.


3 replies

Badge +11

I've done it to limit characters entered to 9, perhaps it might work for you too.  Try:

[A-Za-z0-9]{9}   or   /^[a-z]{0,9}$/

 

9412iCAFC38A6CB38B805.png

 

Userlevel 6
Badge +22
Hi,

Use a calculated Value control set as data type Integer with the function:
length(NameOf MultiLineOfTextControl)
This will give you a live count of how many characters are in the control.

Then set a rule on the Multi Lines of text control to make sure it invalidates if there is less than 200 characters.
Rule: lessThan(length(NameOf MultiLineOfTextControl),200)
Badge +1

Thanks @SimonMuntz, didn't think it would be as simple as that, I already had the rule for validating the size of the box, just wanted it to display to users.

Reply