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 js still loading when using date field

  1. wedideas
    Member

    Howdy,

    After being unable to use the datepicker (I believe their is a js conflict on my page somewhere although only one copy of jquery is being loaded) I decided to switch to a normal date field as it would still fulfill the same function.

    I have noticed though that the datepicker.js scripts are still being loaded on my page. Why is this?

    the jQuery UI version is 70k alone and if it's not being used why is it still being loaded?

    Thanks,

    James

    Posted 10 years ago on Wednesday April 4, 2012 | Permalink
  2. Thanks for the note James. I passed the info along to see about only loading the date picker JS files when the date picker type is selected for the date field.

    Posted 10 years ago on Wednesday April 4, 2012 | Permalink
  3. petros
    Member

    It is still loading it, tested today.

    Posted 9 years ago on Wednesday July 18, 2012 | Permalink
  4. David Peralty

    That is correct, we haven't set this to conditionally load based on field selections yet. It is coming in an upcoming release though. Please be patient.

    Posted 9 years ago on Wednesday July 18, 2012 | Permalink
  5. petros
    Member

    Was angry for sluggish behavior after meddling with gravity forms but it looks like it is my hosting service's fault (bluehost), goes on and off all evening. Cleaning up code is always good, looking forward for the fix.

    Posted 9 years ago on Wednesday July 18, 2012 | Permalink
  6. If you want to unload an unused script in WordPress, you can use the wp_dequeue_script function:
    http://codex.wordpress.org/Function_Reference/wp_dequeue_script

    It might look something like this:

    <?php
    wp_dequeue_script( 'gforms_datepicker' );
    wp_dequeue_script( 'gforms_ui_datepicker' );
    ?>

    You would have to consider when to remove that conditionally (maybe load only on forms you know use the datepicker) and might have to hook it to an action. But that function can be used to remove unwanted scripts which are loaded by plugins.

    Posted 9 years ago on Wednesday July 18, 2012 | Permalink
  7. David Peralty

    The datepicker script is fairly small and lightweight, so it hasn't been too high of a priority, but it will happen at some point.

    It is easy to blame WordPress, Themes and Plugins for poor performance, but often times, it really does go back to the host, and their shared hosting environments. It can be hard to make a profit and provide top notch equipment and support. Hopefully, they can keep your site running well.

    Posted 9 years ago on Wednesday July 18, 2012 | Permalink
  8. I have confirmed that this has been corrected and will be fixed in the next release.

    Posted 9 years ago on Wednesday July 18, 2012 | Permalink

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