This field lets a user pick a date. You are able to set the format the date should be entered in. A pop-up calendar may be provided by the browser.
Various in-built validation options exist which can restrict the date range, or only allowing the user to select weekdays or weekends. The field also includes a regular expression editor and JavaScript validation function if you need to create more complex validation.
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 required to have a value to pass validation | REQUIRED |
Width | The display width of the field. The value matches a CSS class, which actually sets the width | WIDTH |
Format | The format used to store the date. Pick one from the drop-down list. "YYYY-MM-DD" is recommended. Note that the displayed date is not affected by this setting, it will always be formatted according to the user's locale (as determined by the browser or operating system) | FORMAT |
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 an External Type is specified for the form. In this case, the ability to search is determined by the searchable property of the type itself | SEARCHABLE |
Search Format | How the date should be represented in the search index. Select "Date" to index the date as a date/time (UTC). Note that for backwards compatibility with an older version of this field type, it is still possible to index the value as a string | SEARCHFORMAT |
Default | A default value for the field. This must match the format selected in the Format property | DEFAULT |
After Date | Restrict the entered date to one that falls after a particular date. This should be entered in a format that matches the Format property, and we recommend you use YYYY-MM-DD. If the 'Range' setting is set to Future or Future+Today, it will take precedence over any date specified via this setting | AFTERDATE |
Before Date | Restrict the entered date to one that falls before a particular date. This should be entered in a format that matches the Format property, and we recommend you use YYYY-MM-DD. If the 'Range' setting is set to Past or Past+Today, it will take precedence over any date specified via this setting | BEFOREDATE |
Range | Restrict the date that can be chosen to the past or the future, including or excluding today | RANGE |
Valid Days | Use the drop-down list to restrict date input to weekdays or weekends. This setting will not affect the date picker, both weekdays and weekends will still be selectable, but it will be used by the field validation to ensure that the selected date matches the selected option | VALIDDAYS |
Regular Expression | Enter a regular expression that will be used to validate the date. For example, you could restrict the date to any date in June, July or August with: /^..\-0[6-8]\-....$/ This example assumes a date format of YYYY-MM-DD. | REGEX |
Error Message | The error message that will be displayed if this field fails 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 |
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 | VALFUNC |
Default Function | A JavaScript function that can be used to set the default field value. This function is executed server-side when the field HTML is generated. The result of the function must match the format set in the format property (recommended as YYYY-MM-DD) | 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 | 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 |