This field type will allow your customers to provide complete and accurate date and times to reduce any errors from manual entry.
When you should use a date or time field
- When you need the date and/or time in the correct format
- To ensure date and/or time data is provided and recorded consistently
- To make it easier and faster for your customer to provide a date and/or time
When you should avoid using a date or time field
- When you need the responses in a format that is not in a date and/or time
- When the data doesn't need to be validated or constrained to a particular format
Guidelines
Do:
- Use clear labels to ensure customers understand what information is being asked of them
- Include helper text to guide customers on the correct format for entering the information
- Add error messages to help customers correct any mistakes and provide the requested information
Don't:
- Make the fields mandatory unless necessary as the constraints may make it harder for customers to complete the form
Add a date element
- Navigate to Structure > Webforms > Forms and locate your webform by typing its name into the search.
- Open your webform and navigate to Build > + Add element.
- In the Select an element popup, select the Date element.
- Complete the form:
-
Element settings:
- Title: The field label to collect the date
-
Date settings:
- Date days of the week: Show which days you want to show on the date picker. All days are selected by default.
-
Form validation:
- Required: Specify whether or not the field is mandatory
- Required message: Alert that is shown when the customer tries to proceed with the form without providing a date
-
Element settings:
Add a time element
- Navigate to Structure > Webforms > Forms and locate your webform by typing its name into the search.
- Open your webform and navigate to Build + > Add element.
- In the Select an element popup, select the Time element.
- Complete the form:
-
Element settings:
- Title: The field label to collect the time
-
Time settings:
- Time format: Configure how you want to collect the time
- Step: The increment of the time when the customer wants to select a time using the dropdown
-
Form validation:
- Required: Specify whether or not the field is mandatory
- Required message: Alert that is shown when the customer tries to proceed with the form without providing a time
-
Element settings:
Need any more help?
If you have any questions, or require assistance with anything mentioned in this article, submit a request via the webform.