This field lets a user enter a date using separate inputs for day, month and year. While you can choose the format/ordering of the inputs when the field is displayed, the date is always submitted as a string in ISO-8601 format (eg 2023-04-27).
The field includes built-in validation options that let you restrict the date to the past, future, or dates before or after a set date. It also automatically prevents users from entering invalid dates (eg 31st of Feb) and caters for leap years.
You can also write a custom validation function, calculate the default value and trigger a handler when the field value changes.
Properties
Label | Description | Type Name |
---|---|---|
Label | The label for this field | LABEL |
Show Label | Whether to show the label for this field or not. This property adds/removes a class on the field's label element. The styling itself is controlled by the site's stylesheet | SHOWLABEL |
Hint | Additional information displayed alongside the field to assist the user in completing it. The value of another field can be used by adding the field's name between # characters. See Common Field Properties for more information | HINT |
Required | Whether or not the field is needs to have a value to pass validation and allow the page to be submitted. Note that the field will fail validation until a complete date is entered | REQUIRED |
Default | Default value for the field. This must be in YYYY-MM-DD format | DEFAULT |
Error Message | The error message that will be displayed if this field fails its validation | ERRMSG |
Error Message Function | A function that can be used to override the default error message. You can return a different message for each error type. The message can include the value of another field can be used by adding the field's name between # characters. See Error Message Functions for more information. This field has the following error types:
| ERRMSGFUNC |
Searchable | Whether this field's value should be indexed by the search (the object collection if using the database save action and/or workflow process collection if starting a workflow process). This property is ignored if the form is using an an external type (the property is set in the external type itself) | SEARCHABLE |
Display Format | Choose the display order of the input boxes. Options are day-month-year, month-day-year or year-month-day. This only changes how the field appears on the form, the date is always submitted and stored as an ISO-8601 string (eg 2023-04-27) | DISPLAYFORMAT |
Range | Restrict the date date that can be entered to the past or the future, including or excluding today | RANGE |
After Date | Enter a date in YYYY-MM-DD format. The input date must be after this date | AFTERDATE |
Before Date | Enter a date in YYYY-MM-DD format. The input date must be before this date | BEFOREDATE |
Auto-complete | Whether or not the field will try to auto-complete using values stored in the user's browser. Adds the autocomplete HTML attribute to the field. See Common Field Properties for more information | AUTOCOMPLETE |
Day Label | The label that appears above the Day input | LABELDAY |
Month Label | The label that appears above the Month input | LABELMONTH |
Year Label | The label that appears above the Year input | LABELYEAR |
Validation Function | A JavaScript function that can be used to provide custom field validation whenever the field value changes or the form is submitted. This function will be executed client-side, provided JavaScript is enabled in the browser, and repeated server-side. The value to be validated is supplied as a string in YYYY-MM-DD format | VALFUNC |
Default Function | A JavaScript function that can be used to calculate the default field value. This function is executed server-side when the field HTML is generated. The | DEFFUNC |
Handlers | A JavaScript function that is executed client-side whenever the page loads, or the field value changes. This function is useful for modifying the values of other fields based on an entered value. The value is either a string in YYYY-MM-DD format ot an empty string | HANDLERS |
Read Only | Display the field as read only | READONLY |
Additional Styling Modifier | An optional CSS modifier for the field. See Common Field Properties for an example | ADDITIONALSTYLINGMODIFIER |
Documentation | Add documentation to your field to help explain any complex functionality to future users. You might include information on what the field does and how it relates to other fields on the form. Notes added here are only ever visible in the Forms Designer, they can be searched for, viewed and downloaded from the action panel. See Common Field Properties for an example | DOCUMENTATION |