<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: Help getting datepicker minDate working in WordPress</title>
		<link>https://legacy.forums.gravityhelp.com/topic/help-getting-datepicker-mindate-working-in-wordpress</link>
		<description>Gravity Support Forums Topic: Help getting datepicker minDate working in WordPress</description>
		<language>en-US</language>
		<pubDate>Wed, 08 Apr 2026 11:16:39 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/help-getting-datepicker-mindate-working-in-wordpress" rel="self" type="application/rss+xml" />

		<item>
			<title>redkite on "Help getting datepicker minDate working in WordPress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/help-getting-datepicker-mindate-working-in-wordpress#post-77479</link>
			<pubDate>Wed, 26 Sep 2012 10:54:24 +0000</pubDate>
			<dc:creator>redkite</dc:creator>
			<guid isPermaLink="false">77479@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thank you, I got the email too.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Rob Harrell on "Help getting datepicker minDate working in WordPress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/help-getting-datepicker-mindate-working-in-wordpress#post-77473</link>
			<pubDate>Wed, 26 Sep 2012 10:44:19 +0000</pubDate>
			<dc:creator>Rob Harrell</dc:creator>
			<guid isPermaLink="false">77473@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;@redkite, we responded to your priority support request, but I wanted to write the response here as well (since you did not get our response the last time):&#60;/p&#62;
&#60;p&#62;When loading javascript on multi-page forms, you'll want to use the gform_post_render JS hook.&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_post_render&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_post_render&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Code bound to this event will fire every time the form renders to the page. This is good for because it means that when the second page loads, your datepicker script will be initialized on the field.&#60;/p&#62;
&#60;p&#62;As for the datepicker, here is some code I've did a while back to limit the dates which were selectable on the calendar:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://pastie.org/4800232&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/4800232&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Keep in mind, this code is not hooked up for support on mutli-page forms. You'd want want to put this inside the hook I shared above.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bluantinoo on "Help getting datepicker minDate working in WordPress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/help-getting-datepicker-mindate-working-in-wordpress#post-77471</link>
			<pubDate>Wed, 26 Sep 2012 10:37:04 +0000</pubDate>
			<dc:creator>bluantinoo</dc:creator>
			<guid isPermaLink="false">77471@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I have similar issue,&#60;br /&#62;
I'm able to load the mindate.js only using a generic wp_enqueue_scripts,&#60;br /&#62;
does not load with gform_post_paging&#60;/p&#62;
&#60;p&#62;unfortunately even if called, my mindate.js does not restrict my dates, not even using a generic .datepicker selector, simple like this:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;$( &#38;#39;.datepicker&#38;#39; ).datepicker({ minDate: +1 });&#60;/code&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>redkite on "Help getting datepicker minDate working in WordPress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/help-getting-datepicker-mindate-working-in-wordpress#post-73446</link>
			<pubDate>Fri, 31 Aug 2012 10:37:54 +0000</pubDate>
			<dc:creator>redkite</dc:creator>
			<guid isPermaLink="false">73446@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You're right, mindate.js is not being called on either page of this form (#2). This is my code in functions.js:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;/* Enqueue the date script in the paginated Gravity Form */
add_action(&#38;#39;gform_post_paging&#38;#39;, &#38;#39;enqueue_mindate_script&#38;#39;, 10, 2);
function enqueue_mindate_script($form, $is_ajax) {
	// only add the min date script if we&#38;#39;re on a page with form 2
	if( 2 == $form[&#38;#39;id&#38;#39;] ) {
		// this assumes script is named mindate.js and in the child theme &#38;quot;js&#38;quot; folder.  Dependency on jquery
		wp_enqueue_script(&#38;#39;mindate_script&#38;#39;, get_stylesheet_directory_uri() . &#38;#39;/js/mindate.js&#38;#39;, array(&#38;#39;jquery&#38;#39;));
	}
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Is something wrong there? /js/mindate.js does exist.&#60;/p&#62;
&#60;p&#62;As a side note, if I put *this* code in header.php, mindate *is* working correctly in this other form:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;script type=&#38;quot;text/javascript&#38;quot;&#38;gt;
jQuery.noConflict();
  jQuery(document).ready(function($) {
		$( &#38;quot;#input_4_1&#38;quot; ).datepicker({ minDate: &#38;#39;+2d&#38;#39;, gotoCurrent: true, prevText: &#38;#39;&#38;#39;, showOn: &#38;#39;both&#38;#39;, buttonImage: &#38;#39;/wp-content/plugins/gravityforms/images/calendar.png&#38;#39;, buttonImageOnly: true });
  });
&#38;lt;/script&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I tried switching input_4_1 to input _2_35 and it still doesn't work on the form where I need it to.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Help getting datepicker minDate working in WordPress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/help-getting-datepicker-mindate-working-in-wordpress#post-72859</link>
			<pubDate>Tue, 28 Aug 2012 01:09:39 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">72859@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I don't see the mindate.js file included in this page:&#60;br /&#62;
&#60;a href=&#34;http://www.redkitecreative.com/projects/ace/schedule-an-appointment/&#34; rel=&#34;nofollow&#34;&#62;http://www.redkitecreative.com/projects/ace/schedule-an-appointment/&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Is that the problem, or is the problem that when it's included it still does not work?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>redkite on "Help getting datepicker minDate working in WordPress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/help-getting-datepicker-mindate-working-in-wordpress#post-72757</link>
			<pubDate>Mon, 27 Aug 2012 11:48:20 +0000</pubDate>
			<dc:creator>redkite</dc:creator>
			<guid isPermaLink="false">72757@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hello?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>redkite on "Help getting datepicker minDate working in WordPress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/help-getting-datepicker-mindate-working-in-wordpress#post-71970</link>
			<pubDate>Tue, 21 Aug 2012 16:14:37 +0000</pubDate>
			<dc:creator>redkite</dc:creator>
			<guid isPermaLink="false">71970@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Good news! Something's working - I tried making a new form, and putting this in header.php:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;script type=&#38;quot;text/javascript&#38;quot;&#38;gt;
jQuery.noConflict();
  jQuery(document).ready(function($) {
		$( &#38;quot;#input_4_1&#38;quot; ).datepicker({ minDate: &#38;#39;+2d&#38;#39;, gotoCurrent: true, prevText: &#38;#39;&#38;#39;, showOn: &#38;#39;both&#38;#39;, buttonImage: &#38;#39;/wp-content/plugins/gravityforms/images/calendar.png&#38;#39;, buttonImageOnly: true });
  });
&#38;lt;/script&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;THIS is working - it's here: &#60;a href=&#34;http://www.redkitecreative.com/projects/ace/faqs/&#34; rel=&#34;nofollow&#34;&#62;http://www.redkitecreative.com/projects/ace/faqs/&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;So is there something wrong with my other form, or my input ID?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>redkite on "Help getting datepicker minDate working in WordPress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/help-getting-datepicker-mindate-working-in-wordpress#post-71969</link>
			<pubDate>Tue, 21 Aug 2012 16:08:24 +0000</pubDate>
			<dc:creator>redkite</dc:creator>
			<guid isPermaLink="false">71969@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Arggh... this is still not working. Here's what I did:&#60;/p&#62;
&#60;p&#62;1) I added this to functions.php:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[php]
/* Enqueue the date script in the paginated Gravity Form */
add_action(&#38;#39;gform_post_paging&#38;#39;, &#38;#39;enqueue_mindate_script&#38;#39;, 10, 2);
function enqueue_mindate_script($form, $is_ajax) {
	// only add the min date script if we&#38;#39;re on a page with form 2
	if( 2 == $form[&#38;#39;id&#38;#39;] ) {
		// this assumes script is named mindate.js and in the child theme &#38;quot;js&#38;quot; folder.  Dependency on jquery
		wp_enqueue_script(&#38;#39;mindate_script&#38;#39;, get_stylesheet_directory_uri() . &#38;#39;/js/mindate.js&#38;#39;, array(&#38;#39;jquery&#38;#39;));
	}
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;2) I created /js/mindate.js in my child theme with this code:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[js]
jQuery.noConflict();
jQuery(document).ready(function($) {
	$( &#38;quot;#input_2_35&#38;quot; ).datepicker({ minDate: &#38;#39;+2d&#38;#39;, gotoCurrent: true, prevText: &#38;#39;&#38;#39;, showOn: &#38;#39;both&#38;#39;, buttonImage: &#38;#39;/wp-content/plugins/gravityforms/images/calendar.png&#38;#39;, buttonImageOnly: true });
});&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;*All* dates are still available in the datepicker. I checked again to make sure the ID was right:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;[js]
&#38;lt;li id=&#38;#39;field_2_35&#38;#39; class=&#38;#39;gfield&#38;#39; &#38;gt;&#38;lt;label class=&#38;#39;gfield_label&#38;#39; for=&#38;#39;input_2_35&#38;#39;&#38;gt;Please select a preferred date for your appointment.&#38;lt;/label&#38;gt;&#38;lt;div class=&#38;#39;ginput_container&#38;#39;&#38;gt;&#38;lt;input name=&#38;#39;input_35&#38;#39; id=&#38;#39;input_2_35&#38;#39; type=&#38;#39;text&#38;#39; value=&#38;#39;&#38;#39; class=&#38;#39;datepicker medium mdy datepicker_with_icon&#38;#39; tabindex=&#38;#39;29&#38;#39; /&#38;gt; &#38;lt;/div&#38;gt;&#38;lt;input type=&#38;#39;hidden&#38;#39; id=&#38;#39;gforms_calendar_icon_input_2_35&#38;#39; class=&#38;#39;gform_hidden&#38;#39; value=&#38;#39;http://www.redkitecreative.com/projects/ace/wp-content/plugins/gravityforms/images/calendar.png&#38;#39;/&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Could I have something wrong in my form settings?&#60;/p&#62;
&#60;p&#62;Sorry for all the trouble, but if I can't fix this, I have to scrap hours of work and find something else. The client has to be able to restrict dates.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Help getting datepicker minDate working in WordPress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/help-getting-datepicker-mindate-working-in-wordpress#post-70626</link>
			<pubDate>Fri, 10 Aug 2012 17:55:16 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">70626@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;OK, that makes sense.  I'm glad they were able to help.  You can add that JavaScript code to your header whenever you switch pages by using the gform_post_paging hook:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_post_paging&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_post_paging&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;With that, you will write a function to enqueue your javascript, which will happen whenever your form changes pages.  You have the script to add already, you just need to add it now by hooking your function to the gform_post_paging hook.  Do you need help with that?  It will look something like this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;#39;gform_post_paging&#38;#39;, &#38;#39;enqueue_mindate_script&#38;#39;, 10, 2);
function enqueue_mindate_script($form, $is_ajax) {
	// only add the min date script if we&#38;#39;re on a page with form 2
	if( 2 == $form[&#38;#39;id&#38;#39;] ) {
		// this assumes script is named mindate.js and in the child theme &#38;quot;js&#38;quot; folder.  Dependency on jquery
		wp_enqueue_script(&#38;#39;mindate_script&#38;#39;, get_stylesheet_directory_uri() . &#38;#39;/js/mindate.js&#38;#39;, array(&#38;#39;jquery&#38;#39;));
	}
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Save your JavaScript in a file called &#60;em&#62;mindate.js&#60;/em&#62; in a folder called &#60;em&#62;js&#60;/em&#62; in your child theme.  Remove the open and close &#38;lt; script &#38;gt; tags.&#60;/p&#62;
&#60;p&#62;mindate.js&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;[js]
jQuery.noConflict();
  jQuery(document).ready(function($) {
		$( &#38;quot;#input_2_35&#38;quot; ).datepicker({ minDate: &#38;#39;+2d&#38;#39;, gotoCurrent: true, prevText: &#38;#39;&#38;#39;, showOn: &#38;#39;both&#38;#39;, buttonImage: &#38;#39;/wp-content/plugins/gravityforms/images/calendar.png&#38;#39;, buttonImageOnly: true });
  });&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I think that might do it.  Please give it a try.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>redkite on "Help getting datepicker minDate working in WordPress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/help-getting-datepicker-mindate-working-in-wordpress#post-70584</link>
			<pubDate>Fri, 10 Aug 2012 12:43:37 +0000</pubDate>
			<dc:creator>redkite</dc:creator>
			<guid isPermaLink="false">70584@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;This is the answer I got from the jQuery UI forum, but I have no idea what it means or how to apply it:&#60;/p&#62;
&#60;p&#62;&#34;It looks like your page is reloaded between the first and second parts of the form. The first time the datepicker is initialised with minDate (but isn't shown). The second time the datepicker is initialised via the gformInitDatepicker function which doesn't have any minDate set.&#34;
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
