Home › Forums › Quform WordPress › please help prevent past and current date from being chosen
- This topic has 6 replies, 2 voices, and was last updated 6 years, 3 months ago by Ally.
- AuthorPosts
- January 8, 2018 at 1:35 am #23734joeblow44444444Participant
hi all, please help me with a solution to prevent the current date from being chosen. note: not a specific date; whatever the current date is.
i am not a code guru, please explain to me as if i’m a foreign child with step by step extremely specific instructions, the documentation does not provide this.
i found this:
(function() { $( "#datepicker" ).datepicker({ minDate: 1}); });
which works in jsfiddle but i don’t know where to put it or how to make my forms see it. everything i’ve tried either throws an error or is simply ignored by the forms.
January 8, 2018 at 1:55 am #23735joeblow44444444Participanti did see this in the documentation but don’t understand what i’m supposed to do with the extra numbers such as 10, 4
function my_datepicker_prevent_past_dates($options, $dpMinYear, $dpMaxYear, $element) { return "{ minDate: 0, maxDate: new Date({$dpMaxYear}, 12 - 1, 31) }"; } add_filter('iphorm_datepicker_options_iphorm_1_1', 'my_datepicker_prevent_past_dates', 10, 4);
January 10, 2018 at 1:02 pm #23792AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
January 11, 2018 at 2:55 am #23814joeblow44444444ParticipantAs it turns out, the reason I couldn’t find the solution was because I have version 2 but for whatever reason the documentation only refers to version 1. I eventually found the version 2 method you noted above, but wasted a lot of time to do so.
January 11, 2018 at 11:54 am #23825AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
January 13, 2018 at 8:06 pm #23867joeblow44444444Participantwhat about for multiple forms?
January 18, 2018 at 11:31 am #23926AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.