-
-
Notifications
You must be signed in to change notification settings - Fork 449
Open
Labels
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
):
protected function _getTranslateData() |
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!
kiatng and ma4nn