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.

Completely confused with scripts (date picker doesn't work)

  1. Hello,

    I got completely confused with scripts and how they load :( Currently, my date picker doesn't work.

    I'm using latest jquery and jqueryui libraries. I load them in functions.php as following:

    add_action( 'wp_enqueue_scripts', 'dlfrw_enqueue_scripts', 1 );
    function dlfrw_enqueue_scripts() {
    
    	// general jquery & other libraries include
    	if( !is_admin() ){
    		wp_deregister_script('jquery');
    		wp_register_script('jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', false, '1.9.1');
    		wp_register_script('jqueryui', '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js', array('jquery'), '1.10.0');
    		wp_enqueue_script('jquery');
    		wp_enqueue_script('jqueryui');
    	}
    }

    When I click on the date picker, I get the following JS error:

    Uncaught TypeError: Cannot read property 'msie' of undefined ui.datepicker.js:1532
    $.extend._generateHTML ui.datepicker.js:1532
    $.extend._updateDatepicker ui.datepicker.js:616
    $.extend._showDatepicker ui.datepicker.js:582
    (anonymous function) ui.datepicker.js:222
    b.event.dispatch jquery.min.js:3
    v.handle jquery.min.js:3

    I've noticed that this erros is coming from ui.datepicker.js v1.6 script that GF loads itself. I've tried to wp_deregister_script that script, but with no luck.
    How can I fix it please?

    WP: 3.5.1
    GF: 1.6.12

    Posted 11 years ago on Friday March 15, 2013 | Permalink
  2. Richard Vav
    Administrator

    As I mentioned in your other post you are including jQuery v1.9 from google, there have been a couple of issues reported with this version as it was a major re-write and they dropped a lot of features. Gravity forms generally supports the version of jQuery that ships with wordpress which is currently 1.8.3 so try changing your jQuery call to that version and see if it makes any difference.

    Posted 11 years ago on Friday March 15, 2013 | Permalink
  3. Hello,

    @richardvav thank you for letting me know. I've commended out my code with custom jquery completely. So all the scripts are now coming from WP.

    GF CSS in enabled. However, the datapicker doesn't have any styles still.

    The staging websites is at http://gymtopia.dashaluna.com/add-story
    htaccess login details (user/password): adm/adm

    I would hugely appreciate any help. All seems to be working fine in the admin preview of a form, but not on the front end.

    Also, is it possible to delete GF datapicker script in case when I'm adding the whole jqueryui library?

    Many thanks, Dasha

    Posted 11 years ago on Tuesday March 19, 2013 | Permalink
  4. Hi Dasha. I thought I responded to this yesterday but I don't see the reply. I can't get past the Apache basic auth with adm/adm. Can you please try yourself and let me know what I am doing wrong? Thank you.

    Posted 11 years ago on Thursday March 21, 2013 | Permalink