Support

Home Forums Event Espresso Premium Field Validation and the Event Post Type

Field Validation and the Event Post Type

Posted: September 21, 2013 at 1:47 pm

Viewing 1 reply thread


dbishop

September 21, 2013 at 1:47 pm

I just upgraded from 3.1.15P to 3.1.35P and I’m having some troubles with form validation on my custom post for the event.

I’ve delete my old single-event_espresso.php and replaced it with the one provided in the post-type-samples folder in the new release package to get everything up to date.

So I’m now having an issue only with the custom post type registration form (http://www.omlta.org/events/omlta-2013-fall-conference/ )where it doesn’t validate when I hit submit. If I use the default reg link (http://www.omlta.org/event-registration/?ee=9), the validation works as it should.

I’ve updated my jQuery and am not getting any conflicts or errors in my console.

Also, I’ve tried installing the TwentyTen theme and using that and that doesn’t work as well.

  • This topic was modified 11 years, 2 months ago by dbishop.


dbishop

September 22, 2013 at 12:44 pm

Okay I’ve figured out the issue. For some reason the form validation script was not loading for the post type. I added the following to enqueue script function in my theme’s functions.php:

<code>//Add validation to EE Events custom post type
				if (is_singular( &#039;espresso_event&#039; )) {
					wp_enqueue_script(&#039;espresso-validate&#039;, &#039;http://omlta.org/wp-content/plugins/event-espresso/scripts/jquery.validate.min.js&#039;, array(&#039;jquery&#039;), &#039;1.8.1&#039;, true);	
				}</code>

and the following in the actual single-espresso_event.php template:

<code>jQuery(&#039;.btn_event_form_submit&#039;).click(function() { 
	//Registration form validation
	jQuery(&#039;#registration_form&#039;).validate();
});</code>

It seems to be working now.

Viewing 1 reply thread

The support post ‘Field Validation and the Event Post Type’ 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