Forums

Forums / General Discussions / Text Field validation to limit the number of characters

Text Field validation to limit the number of characters

3 posts, 1 answered
  1. Graham Lee
    Graham Lee avatar
    8 posts
    Registered:
    19 Dec 2021
    06 Oct 2022
    Link to this post
    Hi,
    Is there any way that I can limit the number of characters that can be entered into a text field. I have tried unsuccessfully using a custom regex validation. When using the expression ^[^]{0,10}$ I get the message that I have defined after 10 characters have been entered but when I try to submit the form I get an error message saying that the regex expression is invalid. I'm open to any solution!

    Best regards,
    Graham




  2. Omar S
    Omar S avatar
    51 posts
    Registered:
    04 Jul 2019
    Answered
    07 Oct 2022 in reply to Graham Lee
    Link to this post
    hello Graham
    if you don't have any restrictions other than length, could you try this and let me know:
    ^.{1,10}$

  3. Graham Lee
    Graham Lee avatar
    8 posts
    Registered:
    19 Dec 2021
    14 Oct 2022 in reply to Omar S
    Link to this post
    Hi Omar,

    Thank you for the reply! I found the solution 
3 posts, 1 answered