I am a developer for Cognito Forms. When using Cognito Forms on a WordPress site you have two options:
You can download our Cognito Froms Plugin through WordPress. You can then edit your form in WordPress and use the Cog icon to embed your form without having to use any code at all. When using this option some embed code will still be shown but you wont have to worry about copy and pasting it. Below is an example of how that code will look:
[CognitoForms id="1"]
You can embed your form using the embed code that you provided. You will want to make sure you are adding the code to the code view of your content block, you can get to this view by clicking "Text" in the top right corner of the What You See Is What You Get editor(this is also know as a WYSIWYG editor). Once you have added your embed code to this view you can switch back to the normal WYSIWYG editor view by clicking "Visual".
If you need more support or any other help with WordPress plugin please submit a support ticket and we would be happy to help.
I am a developer for Cognito Forms.
Since February 2015 the following functionality has been made available:
In this example, I am setting the range on the Start Date field to =DateTime.Today
. It could have also been =DateTime.Today.AddDays(1)
to be tomorrow or later. Calculations are very robust and should cover most scenarios you can dream up, but you can also just enter literal dates.
I then set the range on the End Date to be at least three days after the Start Date, but no more than seven days. Here is the calculation for the End Date minimum:
And this is how the Start Date appears on the form, with the days before today disabled:
And similarly for the End Date, with both minimum and maximum date restrictions based on the Start Date.
The date range for the End Date automatically updates based on changes to the Start Date, so if an End Date is specified and the Start Date is later changed, validation will catch this if the user does not fix it first.
Please note that range validation applies to Date, Number and Currency fields, not just the dates included in this example.
Best Answer
The minimum and maximum range values in Cognito Forms can either be constant values, like
8/1/2015
or calculations, like=DateTime.Today
. Use this calculation as the minimum to prevent users from entering dates in the past. The date picker will visually show these dates cannot be selected and an error will be shown if they try to type in a date in the past.Range Settings
Date Validation