PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

gform_date_max_year (not working using drop down & changing functions.php)

  1. I'm trying to increase the max year on my form (using the Date Drop Down method, not Date Picker). Right now, my max year is next year (2014) but I'd like it to be at least 10 years out (2023, would be ideal). I tried adding the following code to my functions.php file, but it still didn't work:

    [php]
    add_filter("gform_date_max_year", "set_max_year");
    	function set_max_year($max_year){
    		return 2023;
    	}

    Any suggestions? I really need this option to work. Is this something that involves editing any jQuery files?

    Thanks in advance.

    Posted 7 years ago on Monday February 4, 2013 | Permalink
  2. This does not involve editing any of the plugin files and does not involve jQuery. The filter does work. I am using it on a site like this:

    [php]
    add_filter('gform_date_max_year', 'change_max_year');
    function change_max_year($max_year) {
        return date('Y') + 10;
    }

    To get a max year 10 years out. I'm not sure what's going on with your site. Can you confirm the WordPress and Gravity Forms versions? Also, we need to be sure your theme's functions.php file is being processed. Can you make any other edits to the file whose changes are visible?

    As a last resort, you can check for theme and plugin conflicts by following these instructions http://rkt.gs/testing

    Posted 7 years ago on Tuesday February 5, 2013 | Permalink