I would like the datepickers on my form to open up automatically for October of this year instead of the current month, but I don't want to preselect a specific date.
I am OK with doing this via jQuery if necessary, just need some direction, thanks.
I would like the datepickers on my form to open up automatically for October of this year instead of the current month, but I don't want to preselect a specific date.
I am OK with doing this via jQuery if necessary, just need some direction, thanks.
Here is the datepicker that Gravity Forms uses - http://jqueryui.com/datepicker/ they have tutorials on that page on how to change what it shown when it opens. You'll want to look at their restrict date range, specifically the ability to set the beginning date as a specific date.
So would I then be able to target the existing datepickers called by GravityForms and override the default settings?
If you have a code example of this (even if it's to set different settings) I would really value seeing that, as in my experience getting the format right is usually the hardest part of writing jQuery.
Something like this should work
<script>
jQuery(document).ready(function($){
$( ".datepicker" ).datepicker({ minDate: "+3M" });
});
</script>
You can find more about the various settings in the datepicker api documentation
Edit: Thinking about it if October is going to be fixed you could also use default date like so
$( ".datepicker" ).datepicker({ defaultDate: '10/1/2013' });