When admin selects "Predefined list" for "City options" field but does not enter key|value for "Predefined list of cities" field, it results "City" select input field with no options on the front-end for users to select. A validation is needed in this case.

Furthermore, when admin enter key|value for "Predefined list of cities" field which contains space as following example.

breda | Breda
amsterdam | Amsterdam

This will generate select options with key containing space. When users select an options, the validation will fail because the selected option key contains space. one more validation is needed for this case.

Comments

chansorpea@ezcompany.nl’s picture

The patch above added validations to both cases. Besides that, the patch add "*" sign to the "Predefined list of cities" field to indicate that the field is required based on the state of the "Predefined options".

chansorpea@ezcompany.nl’s picture

Sometimes key might consist of two words with space in between. This should be allowed. Value might contain space since it will be rendered as option label. The patch above validates only key with space as prefix or suffix.

paulvandenburg’s picture

Status: Needs review » Reviewed & tested by the community

Confirmed working.

  • paulvandenburg committed 56875ec on 7.x-1.x
    Issue #2987801 by chansorpea@ezcompany.nl: Validation Predefined list of...
paulvandenburg’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.