Advertisement
chrishajer

Include jQuery for a custom datepicker > (ucWRpX6u)

Apr 10th, 2013
265
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // http://www.gravityhelp.com/forums/topic/date-picker-validation-in-datefield#post-149929
  2. // add a second datepicker with a custom format which will pass validation
  3. // only enqueue the script when form 3 is being embedded
  4. // change the 3 here to your form ID
  5. add_action('gform_enqueue_scripts_3', 'enqueue_custom_datepicker', 10, 2);
  6. function enqueue_custom_datepicker($form, $is_ajax) {
  7.     // enqueue the script to initialize datepicker.  Script is stored in the child theme /js/ subdirectory, and depends on jQuery and the jquery-ui-datepicker script
  8.     wp_enqueue_script('custom_datepicker', get_stylesheet_directory_uri() . '/js/custom-datepicker.js', array('jquery','jquery-ui-datepicker'));
  9. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement