Form Fields: Use regex for validation in input fields

  • Profile Image
    Aegidian
    Asked on July 22, 2016 at 11:59 AM

    Input mask is useful, but it doesn't cover all situations (for example where a limited subset of characters are required.)

    As a programmer I'm used to using regular expressions to specify groups of acceptable characters in a string.

    Is it possible for you to create an input box that verifies its input using a regular expression?

  • Profile Image
    Jim_R
    Answered on July 22, 2016 at 12:25 PM

    Hi! I agree that when you need to filter input fields that require a bit more complex validation, then regex is the go-to solution of most programmers. Yes our input masks work well for simple validation, but at the moment, that's the extent of the capabilities of the form fields.

    However, it's still doable by using your form's entire source code then use Javascript for your regex. A similar thread where a colleague of mine suggested a workaround can be found here http://www.jotform.com/answers/158697 

    For the meantime, I'm adding this as a feature request on your behalf. Although I won't be able to give you any timeframe, rest assured, our developer will take a look at the feasibility of adding this feature and you'll be updated on this same thread once it's available.

  • Profile Image
    Aegidian
    Answered on July 22, 2016 at 12:44 PM

    Thanks, that's pretty much exactly the response I was hoping for.

     

    The solution given in the thread you link is also useful. I'll consider how best to integrate it in future forms.