Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Eric Schrepel 150 posts 203 karma points
    Sep 12, 2013 @ 22:39
    Eric Schrepel
    0

    How to restrict field length using RegEx?

    Having a hard time enforcing maximum field lengths in Contour. According to various RegEx sources, it seems I should be able to put this in the RegEx value for any Contour field to allow a max length of 100 characters (and minimum of none, or empty):

    ^.{0,100}$

    However, it seems to only work sporadically. I added a few of those to a form, tested it, seemed to work. Then got 3 emails today from folks complaining they were well within character limits but still getting validation messages. I tried the form again, and now am getting sporadic results also. (Far less than 100 characters but still returning the validation error.)

    Maybe my RegEx code is incorrect? Or (hopefully not) any differences across browsers?

    Also, the reason I'm adding these is Contour doesn't give any indication that a record has *not* been added to the database (like when field size limits prevented record insertion). Luckily we included an email step in our workflow or those form submissions would have been lost completely.

  • karen 186 posts 461 karma points
    Jan 27, 2015 @ 17:28
    karen
    0

    Hi - Any solution to this?  I need to restrict some textbox input as well.

  • Martin Rhodes 2 posts 72 karma points
    Feb 01, 2019 @ 10:04
    Martin Rhodes
    0

    I was able to get it to work with e.g. ^[\s\S]{0,100}$

Please Sign in or register to post replies

Write your reply to:

Draft