How to apply regular expression in Jotform?

  • familiansb
    Asked on June 24, 2024 at 4:05 PM

    I just joing jotform after a long period using google. Some features here is impressive and the integration with payments are good to go forward.

    But I have a feature to make in form only reachable by regular expression (its about brazilian zip code arragement) and its imperative for me.

    in my case I use a negative for expression: ^(0[1-5]\d{3}-\d{3}|08[0-4]\d{3}-\d{3})$


    there is any other way to make it ?

  • Deanne JotForm Support
    Replied on June 24, 2024 at 4:48 PM

    Hi familiansb,

    Thanks for reaching out to Jotform Support. Regular Expression is still not supported but can you share with us what you want to achieve so we can give you a workaround for it? You mentioned you will use it for the Brazilian Zip Code. The Address element allows form fillers to input their zip code. You might want to try it out. Here's how to add it:

    • Add an Address element to the form.
    • On the right panel, under the Options tab, you can choose which field options to show or hide.

    How to apply regular expression in Jotform? Image 1 Screenshot 20

    If you still need to use regular expressions, you can Get the Full Source Code of Your Form and add in your own code. Just make sure to update the source code every time you make changes to the form.

    Let us know if you have any other questions.

  • familiansb
    Replied on June 24, 2024 at 4:55 PM

    Hi Deanne

    yes, I could reack these steps. But for example in my case, I just can accept zip codes form Sao Paulo city only. No other city is allowed.

    So when I request the zip code (customer require to be zip code), it must be capable to recognize if this zip code is from Sao Paulo city or not (there is few valid zip codes in SP city)

  • Mafe_M JotForm Support
    Replied on June 24, 2024 at 5:41 PM

    Hi familiansb,

    There are various types of widgets available for entering ZIP codes.

    To create a condition, add a Country Picker and a text field. Hide the field with a mask and show a regular input. If this is not what you are looking for, please note that we don't take payments to develop custom widgets. 

    Let us know if you have any other questions.

  • familiansb
    Replied on June 27, 2024 at 9:12 PM

    good to know but but I tested Autocompleted Address Widget and post code search widget and both not worked with Brazilian zip code (CEP).

  • familiansb
    Replied on June 27, 2024 at 9:21 PM

    this CEP (zip code) below is from a famous museum in Sao Paulo city, the MASP museum: 01310-200, but I cant use this to figure out the city in the form

  • Mafe_M JotForm Support
    Replied on June 27, 2024 at 9:29 PM

    Hi familiansb,

    Rest assured, we’ll find a solution for this. Can you share with us a screen recording of what’s happening so we can try to replicate it on our end? You can share the video recording on any public sharing platform like Google Drive or Dropbox, or you can simply use Loom to record the video and share the video link with us.

    Once we hear back from you, we'll be able to move forward with a solution.


  • familiansb
    Replied on June 27, 2024 at 10:33 PM
  • familiansb
    Replied on June 27, 2024 at 10:41 PM
  • Hilary JotForm Support
    Replied on June 28, 2024 at 12:37 AM

    Hi familiansb,

    I'll need some time to investigate on this issue. I'll get back in this thread again when there's any update.

    Thank you for your patience.

  • Hilary JotForm Support
    Replied on June 28, 2024 at 3:42 AM

    Hi familiansb,

    I tried to test on the demo form of Postal Code Search widget. After checking on Google, the full address of the museum is Av. Paulista, 1578 - Bela Vista, São Paulo - SP, 01310-200, Brazil. For the Postal code search, we need to enter postal code after selecting the country. So for the museum, please inter postal code of 1578 instead. Check out the screenshot below:

    How to apply regular expression in Jotform? Image 1 Screenshot 20

    Give it a try and let us know if you need any other help.

  • familiansb
    Replied on June 28, 2024 at 8:46 AM

    Hi team

    I saw your test but it has a mistake. The number 1578 isnt a zip code. Its a build number, so we cannot use this because its will point to a wrong city. Lets me explain that google address show you:

     Av. Paulista, 1578 - Bela Vista, São Paulo - SP, 01310-200, Brazil

    Av Paulista = street name (in this case is a avenue)

    1578 = build number

    Bela Vista = neighborhood or block

    Sao Paulo = the city

    SP = state

    01310-200 = zip code

    Brazil = country



  • Silvano JotForm Support
    Replied on June 28, 2024 at 8:53 AM

    Hi familiansb,

    I tried using 01310-200 and 01310 alone and filtered out the Country to Brazil but I am not getting any result. While the feature you’re looking for isn’t currently available, rest assured we’re always working to add new services and features to Jotform. I've gone ahead and escalated your request to our Developers. When or if it's implemented depends on their workload, how viable it is, and how many other users request it. If there are any updates, we’ll circle back to this thread and let you know. 

    In the meantime, reach out to us if you have any other questions.

  • familiansb
    Replied on June 28, 2024 at 9:00 AM

    ok, thx Im gonna put this project on hold until we have a resolution. But once you guys will ask the development team, I would like to say that a field with regular expression validation already fix this problem. thx !

  • Kris JotForm Support
    Replied on June 28, 2024 at 9:12 AM

    Hello familiansb,

    This is acknowledged and we're glad to know you found a workaround. We will keep this support ticket open so our Developers can message you whenever the feature is available.

    Reach out again if you have any other questions.

  • familiansb
    Replied on June 28, 2024 at 9:21 AM

    HI Kris

    No, I dont find any workaround. In fact Im putting this project on hold once jotform has no solution for my case for while. I still waiting for a solution.

    I just suggested to jotform you can put support for regular expression in roadmap. is it ok ?

  • Harshad_P JotForm Support
    Replied on June 28, 2024 at 9:50 AM

    Hello familiansb,

    I can see that my teammate has already created a feature request for your requirement. However, when will it be implemented depends on the developers' workload and how many other users request it. When its implemented, we will update on this thread.

    Meanwhile, as a workaround what you can do is manually add the address field using the Short Text field for the street/building address and for the city and zip you can use the dropdown field with the options you only want to allow. So if you'd like to allow the city São Paulo city only include that in the dropdown. Let me show you how:

    1. In Form Builder, click on +Add Form Fields.
    2. Add the Short Text field for Street/Building address.
    How to apply regular expression in Jotform? Image 1 Screenshot 30
    3. Add a Dropdown Field and add option only for the cities you want.
    4. Repeat the same for zip code.
    How to apply regular expression in Jotform? Image 2 Screenshot 41
    Give it a try and let us know how it goes.

 
Your Answer