Skip Navigation

[Resolved] Datepicker in front-end form isn't working

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 9 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Tagged: 

This topic contains 10 replies, has 2 voices.

Last updated by dinaraG 9 years ago.

Assisted by: Luo Yang.

Author
Posts
#287972

I am trying to:
Make a cred form that takes some dates
I visited this URL:
hidden link
I expected to see:
a datepicker or another method to enter dates
Instead, I got:
a read-only field and a non-clickable pictogram

#288092

I checked the problem page you mentioned above, there are lots of JS errors:

WPP: OK. Execution time: 0.002509 seconds
<em><u>hidden link</u></em> Failed to load resource: net::ERR_CONNECTION_TIMED_OUT
jquery-ui-1.8.5.custom.min.js:13 Uncaught TypeError: undefined is not a function
2jquery.min.js:2 Uncaught TypeError: Cannot read property 'length' of undefined
<em><u>hidden link</u></em> Failed to load resource: net::ERR_CONNECTION_RESET
<em><u>hidden link</u></em> Failed to load resource: net::ERR_CONNECTION_TIMED_OUT
graphics.js:17 Uncaught TypeError: Cannot read property 'appendChild' of null
datepicker.min.js:11 Uncaught TypeError: Cannot read property 'fadeIn' of undefined

I suggest you try this:
1) deactivate other plugins and switch to wordpress default theme, and test again.
2) enable wordpress debug mode, repeat the actions you mentioned above, and post the debug logs here.
https://toolset.com/documentation/user-guides/debugging-types-and-views/

#288136

Hi, Luoy. Thanks. Datepicker is working on default theme with no errors (I tried it on local site). How can I change my theme. I already tried to comment this code in functions.php file, but datepicker still wasn't working:

		wp_deregister_script( 'jquery' );
		wp_enqueue_script('jquery', get_bloginfo('template_url').'/includes/js/jquery.min.js', false, '1.8.3');
        wp_enqueue_script('jquery-ui', get_template_directory_uri().'/includes/js/jquery-ui-1.8.5.custom.min.js', false, '1.8.5');
		wp_enqueue_script('jquery-superfish', get_bloginfo('template_url').'/includes/js/superfish.js', false, '1.4.2');
        wp_enqueue_script('jquery-slider', get_bloginfo('template_url').'/includes/js/slides.min.jquery.js', false, '1.1.9');
		wp_enqueue_script('jquery-custom', get_bloginfo('template_url').'/includes/js/custom.js', false, '1.4.2');
        wp_enqueue_script('html5', get_bloginfo('template_url').'/includes/js/html5.js', false, '1.0');   

		if ( is_singular() && get_option('thread_comments') ) wp_enqueue_script( 'comment-reply' );
#288329

I can not duplicate same problem in my localhost, what theme are you using? could you post a downloadable URL for it? I need test and debug in my localhost, thanks

#288338

Here is link:
hidden link

#288585

Thanks for the details, I have been able to duplicate same problem in my localhost, the problem is your theme file "black light" is using outdated jquery and jquery-ui version 1.8.3, but CRED is using the wordpress build-in jquery v1.10.4 and jquery-ui version v1.10.4
See the source code of theme file:
\wp-content\themes\blacklight\includes\custom-functions.php, line 20~30:

function my_deregister_scripts() {
		wp_deregister_script( 'jquery' );
		wp_enqueue_script('jquery', get_bloginfo('template_url').'/includes/js/jquery.min.js', false, '1.8.3');
        wp_enqueue_script('jquery-ui', get_template_directory_uri().'/includes/js/jquery-ui-1.8.5.custom.min.js', false, '1.8.5');
		wp_enqueue_script('jquery-superfish', get_bloginfo('template_url').'/includes/js/superfish.js', false, '1.4.2');
        wp_enqueue_script('jquery-slider', get_bloginfo('template_url').'/includes/js/slides.min.jquery.js', false, '1.1.9');
		wp_enqueue_script('jquery-custom', get_bloginfo('template_url').'/includes/js/custom.js', false, '1.4.2');
        wp_enqueue_script('html5', get_bloginfo('template_url').'/includes/js/html5.js', false, '1.0');   

		if ( is_singular() && get_option('thread_comments') ) wp_enqueue_script( 'comment-reply' );
}

But wordpress build-in jquery version is v1.10.4, see the source code of wordpress core file:
\wp-includes\js\jquery.js
And:
jquery-ui version v1.10.4
\wp-includes\js\jquery\ui\jquery.ui.core.min.js

If I remove this these code, it would conduct unexpected result, so I suggest you ask help from the theme author to update the jquery version.

#291951

Hello, thank you for answers.

the theme author said that i need
custom-functions.php file and replace code (only one line):
wp_enqueue_script('jquery', get_bloginfo('template_url').'/includes/js/jquery.min.js', false, '1.8.3');
to
wp_enqueue_script('jquery', 'hidden link', false, '1.10.4');

If I change this one line of code datepicker is not working.
If I remove all string of code this function datepicker is still not working.
Have you any idea ?

#292032

On local version of site I have already changed file :
\wp-content\themes\blacklight\includes\custom-functions.php, ( line 20~30):
comment something and write new code

function my_deregister_scripts() {

wp_deregister_script( 'jquery' );
//wp_enqueue_script('jquery', get_bloginfo('template_url').'/includes/js/jquery.min.js', false, '1.8.3');
// wp_enqueue_script('jquery-ui', get_template_directory_uri().'/includes/js/jquery-ui-1.8.5.custom.min.js', false, '1.8.5');
// wp_enqueue_script('jquery-superfish', get_bloginfo('template_url').'/includes/js/superfish.js', false, '1.4.2');
// wp_enqueue_script('jquery-slider', get_bloginfo('template_url').'/includes/js/slides.min.jquery.js', false, '1.1.9');
// wp_enqueue_script('jquery-custom', get_bloginfo('template_url').'/includes/js/custom.js', false, '1.4.2');
// wp_enqueue_script('html5', get_bloginfo('template_url').'/includes/js/html5.js', false, '1.0');
// if ( is_singular() && get_option('thread_comments') ) wp_enqueue_script( 'comment-reply' );

wp_enqueue_script('jquery', get_bloginfo('template_url').'/includes/js/jquery-1.10.2.js', false, '1.10.2');
wp_enqueue_script('jquery-ui', 'hidden link', false, '1.10.4');
wp_enqueue_script('jquery-superfish', get_bloginfo('template_url').'/includes/js/superfish.js', false, '1.7.4');
// wp_enqueue_script('jquery-slider', get_bloginfo('template_url').'/includes/js/jquery.slides.min.js', false, '3.0.4');
// wp_enqueue_script('jquery-custom', get_bloginfo('template_url').'/includes/js/custom.js', false, '1.4.2');
wp_enqueue_script('html5', get_bloginfo('template_url').'/includes/js/html5.js', false, '1.0');

if ( is_singular() && get_option('thread_comments') ) wp_enqueue_script( 'comment-reply' );
}

This modification of code make datepicker to work normaly. But make problem with slider and with Wiew ! If my pages with wiew-short code include some filters etc - it's not updating fo actions of users with filters. It makes pages static...

if I enable this string

wp_enqueue_script('jquery-custom', get_bloginfo('template_url').'/includes/js/custom.js', false, '1.4.2');

datepicker not working.

#292047

And ... May be will you say your recomendation about change the theme? I need design like my site is now. ( edurobots.ru )

#292253

As I mentioned above, If you switch to use wordpress build-in Jquery library, it could conduct unexpected result, since your theme is using a outdated version of Jquery and Jquery UI, the JS codes in your theme may not compatible with the latest version of Views and CRED.

I don't think there is any workaround within Toolset, and there isn't good reason to keep on using the outdated Jquery and Jquery UI.
All I can suggest you is try Check out our certified partners for it:
https://toolset.com/consultant/

#292776

Thanks a lot!

The forum ‘Types Community Support’ is closed to new topics and replies.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.