How to add a green border if validation is completed when submitting the form
-
14-04-2021 - |
Nessuna soluzione corretta
Altri suggerimenti
I found a quick solution, it is working amazing
- create you module or insert following code in theme requirejs-config.js
var config = { config: { mixins: { 'mage/validation': { 'Expert_Checkout/js/mage/validation-mixin': true } } } };
- validation-mixin.js
define([ 'jquery' ], function ($) { 'use strict'; var widgetMixin = { _create: function() { $(this.element).find('input, textarea, select').on("change keyup", function(e){ $.validator.validateSingleElement(e.currentTarget) }); return this._super(); } }; return function (parentWidget) { $.widget('mage.validation', parentWidget, widgetMixin); return $.mage.validation; }; })
Now it will work on all forms and valdate field as user type and add class valid on success
Thanks
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange