Open
Description
Description (*)
https://github.com/OpenMage/magento-lts/blob/1.9.4.x/js/prototype/validation.js is handling form validation like entry-required
, validate-email
. This is wildly outdated since native options exist now: https://developer.mozilla.org/en-US/docs/Learn/Forms/Form_validation. Native validation removes all responsibility from us, except for adding the <input>
attributes like type=email
. We no longer need to care about translations, UI, adherence to RFCs, etc.
Since it is native, we can also eject (part of the) translations of form validation errors in every page (new Translate
):
Note that security is not affected, both the current and proposed methods are client-side.
Benefits
- Don't validate forms like 2007
- Validate forms like it's 2013 instead!