Issue Bug Closed

#87430Fields which are not required render with required attribute

Jarvis H 01/14/19, 16:02 updated 05/07/19, 12:13

Description

A text field will render with the required attribute even though the “required” setting is not present in the yaml config.

How to reproduce:

Create a form with two text fields, the first set to “required” (see yaml config below).

The required field must be positioned before the non-required field, if it is not the bug does not occur.

Expected outcome:

Only the first field should be required.

Actual outcome

Both fields are set to required, where the second field also has the “required” attribute, but not the label indicator (see attached screenshot).

*Suspected cause*
The formvh:translateElementProperty viewhelper


renderingOptions:
  submitButtonLabel: Submit
type: Form
identifier: test
label: Test
prototypeName: standard
renderables:
  -
    renderingOptions:
      previousButtonLabel: 'Previous step'
      nextButtonLabel: 'Neue Seite'
    type: Page
    identifier: page-1
    label: Step
    renderables:
      -
        defaultValue: ''
        type: Text
        identifier: text-1
        label: 'Required field'
        validators:
          -
            identifier: NotEmpty
        properties:
          fluidAdditionalAttributes:
            required: required
      -
        defaultValue: ''
        type: Text
        identifier: text-2
        label: 'Not required field'

Reviews 2