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.

Datepicker jQuery undefined error

  1. Hi,

    Hoping someone can help. I'm using a datepicker in my forms (sorry, site not live yet).

    I've added some custom jQuery UI config stuff to skip weekends, holidays, etc, but am getting an error on non-datepicker-containing pages because it's looking for jQuery.datepicker.NoWeekends. That's just not loaded on pages where there is no datepicker, so it kicks out an undefined error.

    I've tried testing if the datepicker function exists, but that didn't work - I'm guessing that might be because the jquery ui bits are loaded by AJAX so aren't in the DOM when the document.ready functions run.

    I know this is a little wide of being strictly a GF issue, but would really appreciate any pointers as to how I can detect when I need to load my custom JS code, so that I can beat this error.

    Thanks in advance,

    divydovy

    Posted 14 years ago on Thursday December 16, 2010 | Permalink