What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.

  • Profile Image

    Form Fields: Use regex for validation in input fields

    Asked by Aegidian 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
    JotForm Support

    Answered by Jim_R 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

    Answered by Aegidian 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.