NullReferenceException is thrown when submitting a form with coma in the Label of Submit button


Description

In Sitecore Forms, submitting a form might fail with an unhandled exception in case of a coma in the label field of the Submit button.

For example:

Yes, I confirm

in the label field results in:

Exception: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: Sitecore.ExperienceForms.Mvc
at Sitecore.ExperienceForms.Mvc.Controllers.BaseFormBuilderController.ProcessFormData(FormDataModel data)
at Sitecore.ExperienceForms.Mvc.Controllers.FormBuilderController.Index(FormDataModel data)

Solution

To resolve the issue, consider the following options:


Alternatively, you can use the label of the Submit button without a comma character.