Support

Home Forums Event Espresso Premium Prevent or allow registration based on value of a registration form field

Prevent or allow registration based on value of a registration form field

Posted: June 6, 2023 at 5:18 pm

Viewing 3 reply threads


Digital Services Lab

June 6, 2023 at 5:18 pm

I’d like to limit registration to people within a specific set of post codes. Is it possible to prevent registration if the value in a ‘post code’ field is not within a list I have?

I would need to:

  • Either disable (preferably) or remove the registration button
  • Insert a message somewhere on the form at the point the post-code is entered

The post-code field will be near the top of the form so I need to notify users straight away so they don’t waste their time completing the rest of the form before finding out they cant register.

Is there a filter that can be used to achieve this? A backend php solution would be idea. I don’t want to have to do this with JS.


Tony

  • Support Staff

June 9, 2023 at 5:01 pm

Hi there,

So I’m a little confused by this, you’re asking to instantly process the input so the user doesn’t fill out the whole form and only then find out their postcode isn’t valid, but then don’t want to use JS to process the input to do that.

The only other way I can think of then processing the input is to post the form and use PHP, but you don’t want to do that as they would have to fill out the entire form.

So no PHP and no JS?

Is postcode a custom question or using the zip system question? You could add your own validation strategy to the input with your own regex to validate against if that will work?

The phone number system question does this already so its probably the best field to give an example of:

https://gist.github.com/Pebblo/be5b93e1912f89e8f2c1e7c66c33fcf3

The validation strategy allows you to set the validation error instantly displayed and regex to validate with there, that’s NOT going to do what you are requesting above as is but shows how you can add a validation strategy to a field on the fly.


Digital Services Lab

June 14, 2023 at 2:45 am

Sorry, to clarify, I don’t care if JS is used to solve the problem – I mean I would prefer not to have to roll my own javascript solution from scratch and I’m asking if such a feature exists.
i.e. conditional logic that disables/enables the submit button.

I use Gravity Forms a lot and I has this feature by default so I was wondering if EE also did.

I’ll take a look at the validation strategy and see if I can get that to work. Thanks.


Garth

  • Support Staff

June 14, 2023 at 2:02 pm

No specific feature to allow/disallow based on a form answer (e.g. zip code) value currently exists.

Viewing 3 reply threads

The support post ‘Prevent or allow registration based on value of a registration form field’ 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