Support

Home Forums Event Espresso Premium input mask

input mask

Posted: April 26, 2017 at 12:51 pm

Viewing 3 reply threads


Cod106

April 26, 2017 at 12:51 pm

Good evening,

I would like to be able to add to an entry a verification that these are numbers and that it is mandatory (in this format: 000-000) before validating the form. Is it possible to do this with your EE4 solution?


Thanks for your help


Josh

  • Support Staff

April 26, 2017 at 1:23 pm

Hi Olivier,

The Whole Number question type actually doesn’t limit number of characters or permit a dash in the middle. What you could do is use the Text Question type, then set a maximum allowed response size. Then you can add some custom validation rules using jQuery similar to this example:

https://gist.github.com/joshfeck/86a93df2cddfa7efba7427e66ab0b22b


Cod106

April 26, 2017 at 2:29 pm

Where do I place this piece of code? In which file?

Thanks


Josh

  • Support Staff

April 26, 2017 at 2:48 pm

You wouldn’t actually use the exact same code (you’ll note the example code validates a different regex pattern).

We recommend adding code like this to a functions plugin.

Viewing 3 reply threads

The support post ‘input mask’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso