• 1 reply
  • Latest Post - ‏2014-01-14T23:21:54Z by DonaldN
8 Posts

Pinned topic Limit Multi-Line Character Count

‏2014-01-14T16:10:11Z |

Question:  how would I script (BASIC) to limit a multi-line CQ field to a specific character count? 

Specifically, I'd like to limit a text field to 3,000 characters.

Any help would be much appreciated.

Thanks in advance.


  • DonaldN
    287 Posts

    Re: Limit Multi-Line Character Count


    A multiline_string field essentially contains a string anyway. So I suppose you can just use the "Len" function, or "LenB" if you want bytes, not characters.

    So in the (field/action) validation hook, you retrieve the string length, and throws an exception when it exceeds the given number.