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
Comment #2
chansorpea@ezcompany.nl commentedThe 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".
Comment #3
chansorpea@ezcompany.nl commentedSometimes 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.
Comment #4
paulvandenburg commentedSee also #2987836: Add validation to dvg_webform_components to validate that "Predefined list of cities" is required when "Predefined list" is selected for "City options".
Comment #5
paulvandenburg commentedConfirmed working.
Comment #7
paulvandenburg commented