I think there's an existing topic about this, but I can't access it since my license has expired.
I'm planning to renew my license, but I want to know first if this issue still exist or if there's a way to keep users from picking dates in the past.
I think there's an existing topic about this, but I can't access it since my license has expired.
I'm planning to renew my license, but I want to know first if this issue still exist or if there's a way to keep users from picking dates in the past.
There is a way to do it. It requires adding JavaScript (jQuery) to the page where your form is embedded to restrict the date range. It's not a feature of Gravity Forms, but you can control all the options of the jQuery UI Datepicker. They are documented here: http://jqueryui.com/datepicker/
This JavaScript added to the head section of the page where the datepicker is in use will prevent any past dates from being selected:
<script type="text/javascript">
jQuery(document).ready(function($) {
$(".datepicker").datepicker({ minDate: 0 });
});
</script>
Hey - this is great, just what I was looking for! However, I notice that this doesn't prevent people from typing in what they want. Only the calendar tool is restrcited. Any ideas about blocking the field so that users are forced to use the calendar?
cheers!
-jennyb
To prevent the user from typing into the field, you can make it readonly. See this suggestion: http://stackoverflow.com/a/4164627
Here is how you can make any field in Gravity Forms "read only":
http://www.gravityhelp.com/forums/topic/non-editable-text-field-request#post-151024
Rock n roll! That did it, thank you so much! :D
-jennyb
You're welcome.