Jump to content

Prevent Date Selection Less Than 2 Weeks In Future

Recommended Posts

Hi, all. So, I need to make the calendar date selection tool available to my form's users, but I don't want them to select a date that is less than two weeks in the future. In other words, if today is Sept. 10, the earliest date they should be able to enter/select is Sept. 24.




Thanks much!

Share this post

Link to post
Share on other sites

Hello abitaquest,


On your Submission Form, you can add a Header & Footer element. Then you can select the Footer element, click the "Source" button and enter the following code:


function check_date()
var entered_value = document.getElementById("InsertRecordDate").value;
var entered_date = new Date(entered_value);

var two_week_date = new Date();
two_week_date.setDate(two_week_date.getDate() + 14);

if(entered_date < two_week_date)
      alert("Please select a date after 2 weeks");
      return false;


Please enter name of your field instead of "FIELDNAME" in the line

var entered_value = document.getElementById("InsertRecordFIELDNAME").value;
Also you can enter your message instead of "Please select a date after 2 weeks".
I hope, it helps.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...