PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

JQuery Datepicker Error

  1. Hi,

    I'm setting up a site with the latest Wordpress 3.5.2. I am seeing a Javascript error in Firebug Console when clicking inside my Datepicker text box. The result is that the Datepicker popup doesn't appear.

    TypeError: $.effects.effect is undefined

    I did a little bit of googling, and jQuery may have moved the location of effects and not provided backward compatibility. Any suggestions to fix this?

    Posted 5 years ago on Saturday June 29, 2013 | Permalink
  2. Richard Vav
    Administrator

    Can you provide a link so we can take a look.

    Posted 5 years ago on Saturday June 29, 2013 | Permalink
  3. The site is just running on my dev workstation right now. I could throw up a dummy site and see if I can replicate it.

    Posted 5 years ago on Saturday June 29, 2013 | Permalink
  4. Richard Vav
    Administrator

    When a datepicker field is present on a form Gravity Forms doesn't include or require jQuery UI effects so if it is being included on your page it is either coming from your theme or another plugin and the JavaScript error would suggest it is being included in the wrong position.

    Posted 5 years ago on Sunday June 30, 2013 | Permalink
  5. It does appear to be the theme that's causing the issue. The error is misleading because it seem like the datepicker requires jQuery effects, but perhaps it's just a side-effect.

    Check out this page, maybe some more details.

    http://kenchapple.com/?page_id=4

    I have support on this theme as well, but if you have any ideas what the issue is, I'd appreciate it.

    Thanks,
    Ken

    Posted 5 years ago on Sunday June 30, 2013 | Permalink
  6. Richard Vav
    Administrator

    Hi Ken,

    Well it appears the theme developer has combined a number of scripts including jQuery UI 1.8.21 (which is out-of-date) and jQuery UI effects together in a single file named custom-libraries.js which goes against recommended WordPress standards because WordPress and therefore any plugins you install don't know the file contains these scripts so risk being loaded multiple times causing JavaScript errors.

    You should inform the developer that scripts like jQuery UI should not be combined in a single file, instead they should be included using the wp_enqueue_script method which will prevent plugins who require the same script including it more than once. Towards the bottom of the linked page there is a list of scripts that are bundled in with WordPress and the handle used to enqueue them so there is no need for theme and plugin developers to include those scripts again as part of their theme/plugin package.

    Posted 5 years ago on Sunday June 30, 2013 | Permalink
  7. Thanks! I didn't catch that. That is definitely poor practice. I'll advise the devleopers of the theme. Thanks for your hep!

    Posted 5 years ago on Sunday June 30, 2013 | Permalink
  8. Richard Vav
    Administrator

    You're welcome, it is poor practice and unfortunately it's been the cause of the majority of plugin and theme conflicts I have seen over the past year.

    Posted 5 years ago on Sunday June 30, 2013 | Permalink

This topic has been resolved and has been closed to new replies.