I have a date picker field in my WordPress Website using the Ninja Forms Plugin. I don’t think the plugin gives me the option to restrict past dates. So I want to achieve that the user can not pick any past dates.
I have of course tried to google a solution but I am not really good with javascript/jquery and don’t understand how I can achieve this. Can anyone help? Many thanks in advance!
2
Answers
It appears Ninja Forms has an advance date picker option I am not familiar with it but here is the link
NOW I don’t know the exact Ninja Forms syntax but this should jolt your brain to get started.
Other wise you can create a small custom
WP-plugin
using aadd_filter()
andfunction
likeThis calls on a
JQuery
orJavaScript
function in yourtheme/js/script.js
file or wherever you keep custom JS Which could will could use something like this.Found a solution to this by combining a few things I found across the web while trying to solve this problem.
Simply add this code to any page where you have a date picker where you want to restrict past dates. This one also restricts the current day so they have to pick starting tomorrow.