Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-89935

Form Required Fields popup inconsistently



      Forms required fields function inconsistently within itself and compared to Liferay at large:

      1) Required fields on the first page are only highlighted with the warning "This field is required" after clicking "Next" or entering and removing a value (instead of just being selected.)
      2) Going to the second page, then returning to the first and removing/editing an entry will trigger the warning for just that field. So in essence the first page has 2 different behaviors all of which differ from the second page and the rest of Liferay. This is one of the major inconsistencies. These behaviors go against other places in the portal such as creating Web Content and creating Users, where clicking off of a required field will highlight it until that field is filled which I believe should be the correct behavior. This code is the source of the behavior: https://github.com/liferay/liferay-portal/blob/4328f41e12cb2ac054ccbc4506b8d14be5f9fc1c/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-renderer/src/main/resources/META-INF/resources/js/form_context_support.js#L86
      3) After required fields are highlighted with the warning after clicking "Next", entering any value into any of the fields will remove the highlight on other fields (unlike in User creation) This is only an issue in master, not in 7.1.x
      4) When selecting a highlighted field, the highlight is removed - this does not happen in either the User creation or Web Content Creation case. This is partially controlled here: https://github.com/joshuacords/liferay-portal/blob/e7e75b14608c21b3b2b60ab835d2c20425ededc6/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-renderer/src/main/resources/META-INF/resources/js/field_validation_support.js#L86
      5) Unselecting the text fields will highlight them, checking and unchecking multiple selection will highlight it, but switching between a text type field (Numeric type also behaves this way) and other non-text fields will cause the text fields to not be highlighted on selection or unhighlighted until the field is edited with different values (then the behavior returns).
      6) Selecting the date field without input won't keep it highlighted, similarly highlighting Single Selection or Upload File by selecting or editing and removing is not possible.
      This could be a limitation of these field types, particularly the Single Selection field, but the behavior does differ from other field types.

      Steps to Reproduce:

      1. Create a new Form with 2 pages, on each page add each different field type and have them be Required.
      2. Publish the Form
      3. Put a form portlet on a page and configure it to display the new form.
      4. Play around with entering values into the Required Fields

      Expected Result: Selecting a required field and then unselecting it will show the "This field is required" warning until the field is filled.
      Actual Result: Multiple different behaviors that don't align with the above. See videos.

      Form Required Field 2.mp4 Form Required Field 1.mp4


          Issue Links



              louis.zhang Louis Zhang (Inactive)
              joshua.cords Joshua Cords
              Participants of an Issue:
              Recent user:
              Daniel Couso
              0 Vote for this issue
              1 Start watching this issue


                Days since last comment:
                2 years, 48 weeks, 5 days ago


                  Version Package
                  7.1.10 DXP FP9
                  7.1.3 CE GA4