jblayney
asked on
ACF Date picker doesn't work in front-end form
Hello,
I am using a front end form
http://oalaca.nextmp.net/post-a-job-listing/
<?php acf_form(array(
‘post_id’ => ‘new_post’,
‘new_post’ => array(
‘post_type’ => ‘job_listings’,
‘post_status’ => ‘draft’
),
‘submit_value’ => ‘Post a new Job Listing’
)); ?>
It has 3 date pickers, these 3 all work in the dashboard Add Post form, but they are broken in my public add post form
I do not get any jquery errors in my console
In the Dashboard Add form, all the 3 fields date fields pop up with a calendar date picker
I am using a front end form
http://oalaca.nextmp.net/post-a-job-listing/
<?php acf_form(array(
‘post_id’ => ‘new_post’,
‘new_post’ => array(
‘post_type’ => ‘job_listings’,
‘post_status’ => ‘draft’
),
‘submit_value’ => ‘Post a new Job Listing’
)); ?>
It has 3 date pickers, these 3 all work in the dashboard Add Post form, but they are broken in my public add post form
I do not get any jquery errors in my console
In the Dashboard Add form, all the 3 fields date fields pop up with a calendar date picker
ASKER
Hello,
They are enqueued in the theme.
I did test this yesterday anyway, I included it (jquery 3.1) in the actual page, it didn't make a difference.
They are enqueued in the theme.
I did test this yesterday anyway, I included it (jquery 3.1) in the actual page, it didn't make a difference.
ASKER
and if view source, you will see it loaded on line 63 from the enqueuing
ASKER
In addition, I just copied all the code from the Wordpress dashboard, still no luck
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type='text/javascript' src='http://oalaca.nextmp.net/wp-includes/js/jquery/ui/datepicker.min.js?ver=1.11.4'></script>
<script type='text/javascript'>
jQuery(document).ready(function(jQuery){jQuery.datepicker.setDefaults({"closeText":"Close","currentText":"Today","monthNames":["January","February","March","April","May","June","July","August","September","October","November","December"],"monthNamesShort":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"nextText":"Next","prevText":"Previous","dayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"dayNamesShort":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"dayNamesMin":["S","M","T","W","T","F","S"],"dateFormat":"MM d, yy","firstDay":1,"isRTL":false});});
</script>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Line 63 is a css file.
I did a detailed analysis of your source file and could not find any .js file that provided date functions.
But glad you figured it out.
I did a detailed analysis of your source file and could not find any .js file that provided date functions.
But glad you figured it out.
Check that you are enqueuing the libraries you need for those fields.