Validation of hidden section in Sitecore Forms causes inconsistent behavior

  • In Sitecore Forms, when sections are hidden or shown depending on certain conditions, the validation of fields in hidden sections might fail. For example, the form cannot be submitted, or, in the case of multi-page forms, the validation of fields can fail after returning to the previous page.

  • To resolve this issue, apply the following workaround:

    1. Open the \sitecore\modules\Web\ExperienceForms\scripts\form.conditions.js file.
    2. Replace the following line:
       $target.slideDown();
      with

      // Start of Sitecore.Support.341616 
      // $target.slideDown();
      var $self = this;
      $target.slideDown(function () {
      $self.setRequired($target);
      });
      return;
      // End of Sitecore.Support.341616

    3. Replace the following line:
       $target.slideUp();
      with

      // Start of Sitecore.Support.341616
      // $target.slideUp();
      var $self = this;
      $target.slideUp(function () {
      $self.setRequired($target);
      });
      return;
      // End of Sitecore.Support.341616

    4. Clear the browser's cache.

Applies to:

CMS 9.1 Initial Release+

March 17, 2020
March 17, 2020

Reference number:

341616

Keywords: 

  • Sitecore Forms