Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
The File Upload field allows the users to upload a file along with the Form on your website.
In this article, you will find details about the configuration options you have for the File Upload field.
You can choose to specify which files you want to allow the user to upload, when accessing the Form.
To allow only specific files:
Select the File Type checkbox the user should be able to upload.
Click Submit.
We recommend selecting Allow only specified files, to limit malicious code to be uploaded, whenever the user is submitting the Form.
If the list of predefined file types do not include a specific file type, you can add additional ones.
To add new file type:
Type a file extension name in the User defined allowed file types field and click add.
Click Submit.
In this article, you will find information about accessing the Forms Settings and the validations available to customize your Form.
To access the Form Settings:
Navigate to the Forms section.
Open a Form you wish to customize.
Click Settings in the top-right corner of the screen.
The following options are available in Forms Settings:
By default, all submitted records are saved in the database. This option allows you to view and export the saved records from the queries overview. If you do not want to store data (due to policies in your organization), you can uncheck the box.
Disabling this option will prevent database records from being stored, but any file uploads made as part of the form submission will still be retained. If you do not want the files to be stored, ensure that any process or method used to process, move, or copy them to a different location also removes the file.
Customize the labels of the Submit, Next, and Previous buttons used in your Form.
Set a stylesheet to give your Form custom styling. You have an option to disable the default styling. Enabling the Disable default stylesheet option will prevent a default stylesheet to be added to the pages where the Form is placed.
Define a message that is displayed when a field is mandatory, when a value is not supplied, or when the value is invalid.
The following Validations are available:
The autocomplete setting for the overall form can be changed from the default of "None" to "On" or "Off". Setting this explicitly will control how the browser offers automatic prompts to the user when completing the form.
Enabling this feature allows the moderator to manage the approval status of a form. This can be used in a number of scenarios. For example, if the form submission will be publicly shown, you can control which are published.
By default, a constant set of fields are displayed when form entries are shown in a list. You will see the first three fields in the form, plus some system information like the record state and the date it was created.
To customize this, turn off the "Display default fields" option and select the ones you wish to display.
To help protect site visitor privacy, rules can be configured in this section for the automatic deletion of submissions. You can set how long to retain records for each state (submitted or approved).
A background service that carries out the actual removal of records needs to be enabled in configuration. If that is not running, a notification will be displayed.
In this article, we'll take a look at the basic steps of creating a Form and adding the Form to your Umbraco site.
You can manage the Forms in the Forms section of the Umbraco backoffice. You need to have access to the section in order to see it.
If you do not see the Forms section, you might need to request access from the site Administrator. An Administrator can give permission to view the Forms section. This is done from within the Users section of the backoffice.
To create a Form, follow these steps:
Navigate to the Forms section.
Click ... next to the Forms folder.
The Create a new Form dialog opens.
Select Empty Form. The Form Designer opens in the editor.
By default, there is a page, a fieldset, and a container available. The rest of the Form has to be added using the interface.
Enter the Name for the Form. Let's call it Our first form.
[Optional] Enter the Page Name. We'll call it The first page. Click Add new page at the bottom of the Forms designer to add more pages.
[Optional] Enter the Group Name. Click Add new group to add another group.
Click the Add Question button to add a new field.
The Add Question dialog opens.
Enter the following details:
In the Sensitive data field, choose if the field stores sensitive data. Once selected, the data from this field will be prevented from being downloaded and viewed by users who do not have permission to do so. Only members of the sensitive data user group will see this option of downloading.
Enter a Default Value for the field.
Add a Placeholder to make it easier for the user to fill in the Form.
Select if the field is Mandatory and customize the message.
Add a Validation to the field. There are some predefined validations available but it is possible to add your own custom validation as well.
Some form fields allow you to show or hide the label that's associated with the field when it is rendered within the form on the website. The default is always to show the field, but if you prefer to hide it, untick the Show label option.
Set Conditions for the field. For more information on Conditions, see the Setting-up conditional logic on fields article.
Some of the additional settings are dependent on which answer type was chosen. For example, since we selected Short Answer as our answer type we got two additional settings (Default Value and Placeholder).
Once the configuration is completed, click Submit. You will see that the field has been added to the Form designer.
To edit a field that has already been added to the Form, click the little cog icon next to the field to open the dialog. To delete a field or a group, click the Recycle Bin icon.
Once you've added a few fields to your Form, you might want to change the order of questions. To do so, click Reorder in the top-right corner of the Form designer.
When reordering your Form, you can drag and drop the fields to make it look the way you want. Click I am done reordering to get back to the Form designer.
Forms can be grouped into pages. When rendered, each page will be presented one at a time to the user. They will need to complete the first page before moving onto the second and can navigate back and forth between pages.
You can add a new page directly to the bottom of the form via the Add new page button. This will appear below other pages when at least one exists.
With a page, form fields can be arranged into groups. These will display all together on a single page but can be styled so the fields are appropriately grouped in fieldsets.
New groups are added via the Add new group button.
The last level of structure are columns that can be created within a group. To set the number of columns click the cog icon next to the group. You will then be able to add or move fields to the new columns created.
Once you are satisfied with the Form, you can save the design by clicking the Save button.
If installation of the product is configured for storage of form definitions in the database, you will have the option to store forms within folders. If you are planning to create a number of them, this may help with organization and locating them once created for modification.
To create a folder, access the same dialog used for creating a form. Here, you'll have the option to create a folder, for which you need to provide a name.
You can create folders within folders, rename, move and delete them. You also have the ability to move or copy forms into folders, all via the tree operations available from the ... menu.
To add the Form, follow these steps:
Navigate to the Content section of the Umbraco Backoffice.
Select the content page where you want to insert the Form. The page you choose should either have an Rich Text Editor (RTE) field, a Grid Editor, or a form picker all of which you can add in the Settings section under Document Types.
Click the Insert macro button in the toolbar of the RTE or Grid. The Select Macro dialog opens.
Click Add under Choose a Form and select the Form you want to insert. You will be able to select from the full list of forms. If available on your installation, you will also be able to select using a folder based view, which can be quicker to navigate when many forms have been prepared.
[Optional] Click Add under Theme to choose which theme the Form should use.
Finally you have an option to Exclude Scripts.
Click Submit.
The Form is inserted on to your page. Click the Save and publish button.
Sometimes you might have a field in your Form, that you want to show only if the user has entered a specific value in another field.
You can achieve this setting by using conditional logic on Fields.
Take a look at the following:
In this case, it makes sense to only show the email or phone field when the corresponding option is selected in the How should we contact you? field.
To enable conditions for the Email and Phone fields, do the following:
Click the cog
wheel next to the Email and Phone field. The Edit question dialog opens.
Select Enable Conditions in the Conditions section.
Enabling the condition field displays more options:
Set the appropriate conditions and click Submit.
There are two Action Types:
Show: the field will be displayed if the rules match
Hide: the field will be hidden if the rules match
Next up, you'll need to specify the Logic Type. This setting is only important if you have multiple rules.
All: All of the rules must match
Any: Any of the rules may match
When adding a new condition, you'll need to select the field where you want to evaluate the value and can select an operator.
In this example, we only want to show the Phone field if the value of the How should we contact you field is Phone
.
Similarly, you can display the Email field, if the value of the How should we contact you field is Email
. You can see the conditions added to each field in the Forms designer:
When both the conditions have been set as shown above, this is how it will look on the frontend:
In this example, we have only selected Phone but it is possible to choose both Phone* and Email and display both the fields.
As well as showing or hiding a field based on conditions, you can also apply conditions to groups of fields (known as fieldsets) or to pages. The process is the same as described above.
When applying a condition to a page, effectively you are controlling the display of the submit button (for a single-page form) or the next/previous buttons (available on multi-page forms). In this way you can ensure that the entry so far is complete before accepting it or allowing the user to move onto the next page.
You can apply conditions to dates as well as strings. When you use the date picker field, you can set a condition if a submitted date is greater/less than a specific date.
Umbraco Forms comes with many default Field Types, also known as Answer Types. You can choose from these options when adding new fields to your Forms.
By default, the following Field Types are available:
Short Answer: A textbox allows up to 250 characters.
Long Answer: A bigger text field that allows multiline text and more than 250 characters.
Date: Displays a picker that allows the user to select a date.
Checkbox: Displays a single checkbox that can be checked or not.
File Upload: Allows user to select and upload a local file.
Password: Allows to type a password. The input is not visible when typing.
Multiple Choice: Displays a list of items with a checkbox for each item where the user can select multiple options.
Data Consent: A field for the purpose of asking for data consent. By default, this field is added to all new forms created with Forms version 6+.
Dropdown: Displays a list of items in a drop down box where the user can select a single option.
Single Choice: Displays a list of items with a radio button for each item where the user can select a single option.
Title and Description: Displays a read-only title and description for a set of form fields.
Rich Text: Displays read-only formatted text that can be used to provide additional information and links within a form.
Hidden: A hidden field allows developers to include data that cannot be seen or modified by users when a Form is submitted.
Recaptcha V2: The field displays a single checkbox for the user to select in order to validate the Form.
Recaptcha V3 with Score: This field returns a score for each request without user interaction. The score is based on user interactions with the site and enables you to take an appropriate action for your site based on the score.
The date picker uses a front-end library called to display a UI to pick dates.
Pikaday date picker can be localised based on the page the Form is rendered on.
The date picker displays the picked date in the required locale. Using JavaScript, a hidden field is updated with a standard date format to send to the server for storing record submissions. This avoids the locale mixing up the dates.
To achieve localized date, a Razor partial view is included at /Views/Partials/Forms/Themes/default/DatePicker.cshtml
.
The DatePicker.cshtml includes the moment-with-locales.min.js
library to help with the date locale formatting and the appropriate changes to Pikaday to support the locales. If you wish to use a different DatePicker component, edit the DatePicker.cshtml file as per your needs.
The Date picker has a configuration setting to control the number of years shown in the picker. The default value is 10 years.
You can configure the settings in the appSettings.json
file:
Update DatePickerYearRange
to a higher number (for example: 100) to increase the numbers of years available in the Date picker.
In Umbraco Forms, reCAPTCHA V3 comes out of the box.
reCAPTCHA v3 allows you to verify if an interaction is legitimate without any user interaction.
Follow these steps to enable reCAPTCHA V3 in Umbraco Forms:
Go to the Forms section in the backoffice.
Find the form that should have ReCAPTCHA v3 enabled.
Add a new question and select ReCAPTCHA v3 with Score as its answer type.
Make sure the field is set as Mandatory.
Configure ReCAPTCHA settings in the appSettings.json
file to include public and private keys:
In Umbraco Forms, reCAPTCHA V2 comes out of the box to help you to protect your site from spam, malicious people, and so on.
Follow these steps to enable reCAPTCHA V2 in Umbraco Forms:
Go to the Forms section in the backoffice.
Find the form that should have ReCAPTCHA v2 enabled.
Add a new question and select ReCAPTCHA v2 as its answer type.
Make sure the field is set as Mandatory.
Configure ReCAPTCHA settings in the appSettings.json
file to include public and private keys:
Validation Type | Description |
---|---|
Field Name | Value |
---|---|
You can create your keys by logging into your .
You can create your keys by logging into your .
Mandatory error message
The error message is displayed for a field that is marked as mandatory but a value has not been provided upon submission. This setting can be overwritten on a field level - {0}
will be replaced with the field caption.
Invalid error message
The error message is displayed for a field if the value provided is not valid (a regular expression has been setup but the input does not match). This setting can be overwritten on a field level - {0}
will be replaced with the field caption.
Show validation summary
Enable this option if you wish to display a summary of all the error messages on top of the Form.
Hide field validation labels
Enable this option if you wish to hide individual field error messages from being displayed.
Mark fields
You can choose to not mark any fields or only mark mandatory or optional fields.
Indicator
Choose which indicator to use when a field has been marked as mandatory. The default indicator is *
Enter question
Name
Enter help text
Enter your name here
Choose answer type
Short answer