Posted: October 12, 2012 at 5:48 am
|
The validation isn’t working on any of the forms. So users can go all the way to the end of the signup process without entering any details at all. Past suggestions for getting the validation working (wrapping in [raw] tags) doesn’t seem to do anything. When looking at the output html, there doesn’t appear to be any place where the validation function is called. Would you guys have any more tips on finding out where the validation might be breaking? Another questions though; If users are able to get through the process without the JS validation working, does that mean that there is no server side validation in place? Or is my plugin broken on both ends? Cheers |
|
Hi Tom, Generally this is due to a Javascript conflict or the Javascript being called incorrectly. Do you have a link to the site in question? The forms are only validated via the Javascript. |
Hi Tom, If the script isn’t being called at all, this is likely from the WordPress theme not including the wp_footer() function. In order for most plugins to function properly, there needs to be a call to wp_footer in the footer.php template of the theme. If it’s not there, you may need to contact the theme’s developer, or you can add it just before the closing body tag. Please see this reference for more info: |
|
|
Dean, this is the site in question Josh, good call. The theme didn’t have the wp_footer() set. That done, the JS is still fhrowing up the error Any ideas? |
Hi Tom, The root of the problem here is there is a few things in this theme that are not following WordPress coding standards. So there are some dependancies that are not being met. Looking at the source of the page again, I can see that the jQuery library is loading after the validate script. That’s why validate has no method. If if gets removed and added at an earlier part of the document, the validation script will work. You can look in footer.php to see how it’s being called there, and check header.php to see if wp_head() is being called. (If it’s not there, it really needs to be.) Ideally, jQuery will load automatically in wp_head() if all the scripts that need it declare it as a dependency. You can also enqueue it from the functions.php file, and it will load the head of the document in the event that a script needs it, but doesn’t declare it. So in functions.php you can add:
Here’s a simulated version of the above linked page with the jQuery library moved to the head of the document: Here’s a reference that goes into more detail about how JavaScript should be loaded in a WordPress theme: |
|
|
Josh, sorry aout this. It’s a silly error: the head didn’t have the wp_head(). Thanks for the support : ) |
The support post ‘Signup Validation’ 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.