abitaquest Posted September 18, 2015 Report Share Posted September 18, 2015 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. Ideas? Thanks much! Quote Link to comment Share on other sites More sharing options...
iren Posted September 21, 2015 Report Share Posted September 21, 2015 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: <SCRIPT LANGUAGE="JavaScript"> 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; } } document.getElementById("caspioform").onsubmit=check_date; </SCRIPT> 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. abitaquest 1 Quote Link to comment Share on other sites More sharing options...
abitaquest Posted September 21, 2015 Author Report Share Posted September 21, 2015 This is perfect! Thank you, iren! You've saved my team a mountain of headaches. Quote Link to comment Share on other sites More sharing options...
iren Posted September 22, 2015 Report Share Posted September 22, 2015 I am glad my suggestion helped Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.