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.

Date picker not restricting users to previous date

  1. aidilism
    Member

    Hi there.

    I've an order form here http://www.riverwalktandoor.com.sg/wordpress/?page_id=291

    One issue I have is that user can pick a date that is before today's date. How can I disallow users to choose back dates and can only choose future dates?

    Thanks.

    Posted 12 years ago on Sunday August 7, 2011 | Permalink
  2. There is no built-in restriction that forces the user to pick a date in the future. The date picker could be used just as often for dates in the past like birth dates, etc.

    The datepicker is part of the jQuery UI library and you can customize it for your site by adding a little script and passing some variables to it. You can find out more information on the jQuery UI site here.

    http://jqueryui.com/demos/datepicker/

    just look for the link on the right that says "restrict date range"

    Posted 12 years ago on Sunday August 7, 2011 | Permalink
  3. JohnnyL
    Member

    Hello,

    I would also need to incorporate this type of restriction.

    Were would I need to add the the below ?

    $(function() {
    		$( "#datepicker" ).datepicker({ minDate: -20, maxDate: "+1M +10D" });
    	});

    Thanks !

    PS: Great Product and even Better Support ! :)

    Posted 12 years ago on Monday August 8, 2011 | Permalink
  4. @JohnnyL

    You would place that in your theme's header.php file inside the < head> section of the markup, if you have an external javascript (.js) file that gets called in, you can include it there.. you'll just need to leave the opening and closing script tags out if you put it in the .js file.

    http://www.gravityhelp.com/documentation/page/Where_Do_I_Put_This_Code%3F

    Posted 12 years ago on Monday August 8, 2011 | Permalink
  5. JohnnyL
    Member

    Thank You :)

    Cheers,
    Johnny

    Posted 12 years ago on Monday August 8, 2011 | Permalink

This topic has been resolved and has been closed to new replies.