View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006852 | Flow theme | Theme | public | 2018-07-03 14:49 | 2023-06-29 13:10 |
Reporter | robert blank | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | no change required | ||
Product Version | 3.0.1 | ||||
Target Version | 3.0.2 | ||||
Summary | 0006852: Required HTML select element is not validated on HTML / JavaScript level | ||||
Description | In 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 Reproduce | Configure 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 Information | Browser: - Google Chrome Version 69.0.3472.3 (Offizieller Build) dev (64-Bit) - Firefox Quantum Version 61.0 (64-Bit) | ||||
Tags | No tags attached. | ||||
|
Error exists in wave-theme too. |
|
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. |
|
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. |