Support

Home Forums Event Espresso Premium Registration form validation issue

Registration form validation issue

Posted: April 1, 2015 at 8:42 am


Borisas Bylinskis

April 1, 2015 at 8:42 am

Hello,

I am using the latest EE4 and I absolutely love it, great job guys! However I also have one small issue, I need to be able to validate the age of attendees (must be over 18), therefore could please anyone tell me how can I extend default form validation with date validation? Also could you please answer, where should I put the validation code, so it stays after module update?

I would really appreciate your help and if it would be possible some dummy code snippet:)

Looking forward to hearing from you.
Website: http://www.jaunimoregistracija.lt/registracija/


Lorenzo Orlando Caum

  • Support Staff

April 1, 2015 at 11:13 am

Hi, the issue is that a person that is under the minimum age could enter or pick a different birth date.

Have you considered adding text to the event description to say that the event is 18 and up?

Then you could follow that up with a required “terms” question that they’ll need to check which states that they are at least 18 years of age.


Lorenzo


Borisas Bylinskis

April 1, 2015 at 11:54 am

Hello,

thank you for your answer, however it doesn’t really solve my issue because ability to validate the date is a requirement from my client, also I am trying to understand how can I add validation to EE4 form, because I am planning to validate some input fields as well (there are some questions where only numbers allowed in the answer).

Therefore please could you explain how can implement validation for the EE4 form, I will write the validation rules myself, I just need to know how to inject those rules so it would work well with your current validation methods.

Waiting for your answer.


Lorenzo Orlando Caum

  • Support Staff

April 1, 2015 at 12:01 pm

Hi, here is an example that works alongside the existing validation:

https://gist.github.com/e39ba6aa9ec60a59fc93


Lorenzo


Borisas Bylinskis

April 1, 2015 at 4:51 pm

Thank you,

I have sucessfully implemented the date validation, even though it doesn’t tap into your server side validation or display notices that are shown on form submission, still you have been a huge help, thanks:)

P. S. It would be great feature for future releases to have an ability to control form validation through admin interface, conditional input fields would also be great feature.


Lorenzo Orlando Caum

  • Support Staff

April 2, 2015 at 9:27 am

Hi, glad to hear you got this working. We are working on some improvements to the registration form system and those will be rolled out in a future versions of Event Espresso 4.

Thanks


Lorenzo

The support post ‘Registration form validation issue’ 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