View Issue Details

IDProjectCategoryView StatusLast Update
0006852Flow themeThemepublic2023-06-29 13:10
Reporterrobert blank Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Product Version3.0.1 
Target Version3.0.2 
Summary0006852: Required HTML select element is not validated on HTML / JavaScript level
DescriptionIn vendor/oxid-esales/flow-theme/tpl/form/fieldset/salutation.tpl there is HTML element like this:

<select name="editval[oxuser__oxsal]" class="form-control selectpicker show-tick bs-select-hidden" required="required">
    <option value="">Please choose ...</option>
    <option value="MRS">Frau</option>
    <option value="MR">Herr</option>
</select>

Flow them uses bootstrap-select to nicely style and enhance the select element.
What is not working is the browser side validation of the required attribute of the select element.
In the example above, if "Please choose ..." is chosen there will be no error rendered by the browser.
Steps To ReproduceConfigure salutation as a required field in
eShop admin -> Master settings -> Settings -> Other settings -> Mandatory fields of the contact form
Select Salutation
Save the form

Go to <eShop URL>/index.php?cl=contact

Note that "Salutation" is marked as a required field.
Try to submit the form without choosing a value for "Salutation"

A validation error is expected to be shown, but no error will be shown.
Additional InformationBrowser:
- Google Chrome Version 69.0.3472.3 (Offizieller Build) dev (64-Bit)
- Firefox Quantum Version 61.0 (64-Bit)
TagsNo tags attached.

Activities

mario_lorenz

2021-02-10 13:48

developer   ~0013378

Error exists in wave-theme too.

mario_lorenz

2021-02-14 15:23

developer   ~0013379

When someone stumbles across the same problem. I solved it by using two inline radio inputs instead of the Select. With that the validation works and it doesn't look bad either.

SvenBrunk

2023-06-29 13:10

manager   ~0015348

This bug report is invalid. The validation works also just fine in selects. (Tested in Apex theme.)
The issue is the following: The field "salutation" does on purpose not contain an empty value for "Please choose", but a space.
This is because, for anti-discrimination reasons, we do not want this field to force a selection.

To verify this: go to the source code of this form and replace the space with an empty string like this:
<option value="" selected="">Please choose ...</option>
Actually in recent versions it reads "not specified" for the very same reason.