Posted: September 25, 2013 at 5:12 pm
|
Form validation is not working when I use the http://stage.striptrips.com/itinerary/ Is the page that is experiencing the problems. (everything is in test mode)
|
|
Hi Brittany, Yep that isn’t working. I cannot see an easy workaround right now so I will raise a ticket to get that looked into. |
|
Sorry I do have a workaround, it is a bit rough but should get the job done. Add it to your themes functions.php file and change XXXXXX to your site url. function ee_val() { wp_enqueue_script('jquery'); wp_enqueue_script("espresso-validate", "http://www.XXXXXXXX.com/wp-content/plugins/event-espresso/scripts/jquery.validate.min.js", array("jquery"), "1.8.1", true); ?> <script type="text/javascript"> jQuery(".btn_event_form_submit").click(function() { //Registration form validation jQuery("#registration_form").validate(); }); </script> <?php } add_action('wp_footer', 'ee_val'); |
|
September 26, 2013 at 10:37 am Looks like you have some syntax errors, so I went and corrected them but it still doesn’t seem to work. Here is the code with my corrections: |
|
September 26, 2013 at 10:39 am Alright, I am so very confused. Now I understand why the code had errors, its getting changed when posted to the forum. |
Hi Brittany, Can you try this instead? If you open up /event-espresso/includes/shortcodes.php you’ll find the very first shortcode listed is [SINGLEEVENT]. Just below where it says on line 20: global $load_espresso_scripts; $load_espresso_scripts = true; //This tells the plugin to load the required scripts You can add these two lines: wp_enqueue_script('jquery.validate.js', (EVENT_ESPRESSO_PLUGINFULLURL . "scripts/jquery.validate.min.js"), array('jquery'), '1.8.1', TRUE); wp_enqueue_script('validation', (EVENT_ESPRESSO_PLUGINFULLURL . "scripts/validation.js"), array('jquery.validate.js'), EVENT_ESPRESSO_VERSION, TRUE); and save the file. This will ensure that the validation scripts load where ever you have the [SINGLEEVENT] shortcode. |
|
|
Should I use the custom code plugin? |
You could use the custom files add-on by copying over the entire shortcode function from shortcodes.php into custom_functions.php and modifying it there. You could also make the change in the core plugin. |
|
|
September 27, 2013 at 10:47 am I copied over the code, inserted the code you gave me, and it works! Thanks for your help! |
The support post ‘Form validation with [SINGLEEVENT]’ 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.