Answered

Regular Expression text field validation


Hi,

Is it possible to have regex validation of text fields in a survey?
We have some formats that input needs to adhere towards.

 

Best,

Simon - Kollektiv

icon

Best answer by Liz 22 June 2021, 18:10

View original

12 replies

Userlevel 7
Badge +5

Hi @Kollektiv thanks for stopping by the community! Out of box, we don’t have this feature, but this may be possible to setup with logic jumps. Would you mind sharing a bit more about what you’re looking to validate? 

Hi Liz,

I’m circling back on this question by my colleague, Simon. We’re currently using regular text fields to capture time inputs on a key Typeform that is used to capture user data when onboarding to a personalised athletic training service. The Typeform is built into a web container within our mobile apps. The time inputs that we are capturing need to adhere to the HH:MM:SS format. We’re trying everything to communicate explicitly to the user the importance of correct input, however we consistently see input errors on the output data.

It is the time input data that we are looking to validate. Even better if there is a time input field HH:MM:SS that we’re unaware of :)

Thanks,
Ben @ Kollektiv 

Userlevel 7
Badge +5

Hi @Kollektiv Thank you!! That helps! We don’t have an option to validate the time this way within the same field. You could use a separate field for hour/minute/second and have logic jumps set to prevent the respondent from submitting if it’s not the proper format. 

Theree is a way to use regex to validate an input?

Userlevel 7
Badge +5

Hi @Wilson Neto I’m afraid we don’t have this feature available but do you mind sharing more about your use case? We can try to think of some workarounds!

Is this feature on the roadmap?  Its a bit of a blocker for us choosing to use Typeform, we are currently evaluating form software providers and this is one of our core requirements

Userlevel 7
Badge +5

Hi @Nick Smith This feature isn’t on the roadmap, but do you mind sharing your use case for it? That would be helpful for our product team to know when evaluating which features to build. 😀

Ah that is unfortunate as it probably means we can’t use typeform.  I want to apply regex validation to a field so that I can ensure the data entered matches the expected pattern.  e.g. we need to capture our customers UK bank account and sort code, or their company registration number.  These will have certain field validation requirements

Userlevel 7
Badge +5

Ah, got it, @Nick Smith . Thanks for sharing that - that helps us understand the use case behind it. I’ll share with product!

Badge

+1 for this. Need to validate a “hidden field”

Userlevel 5
Badge +5

Also interested in having custom regex and custom placeholder. Maybe you coud have a specific field that would be more permissive.

Use cases: UK postal code / US SSN or EIN / plate numbers / specific date formats such as MM/YYYY, or including time

  

+1 for this. Need to validate a “hidden field”

A hidden field can be validated in Javascript before passing it to Typeform

This is a completely obvious feature to include.

 

This forces me to allow my form to accept “*@!#&*)!@(#*!@)#(*!)@#” as an input to a simple name field...

Reply