Skip to content

Instantly share code, notes, and snippets.

@timneutkens
Last active August 7, 2016 13:44
Show Gist options
  • Save timneutkens/3a18f539f2646c083da9d7bfab6a5555 to your computer and use it in GitHub Desktop.
Save timneutkens/3a18f539f2646c083da9d7bfab6a5555 to your computer and use it in GitHub Desktop.
Magento2 get javascript validation classes like validate-number etc. can be ran on front-end and admin panel
(function() {
var exec = false;
if(typeof requirejs !== 'undefined') {
exec = requirejs;
} else if (typeof require !== 'undefined') {
exec = require;
} else {
console.log('require.js not found');
return false;
}
exec(['jquery', 'mage/validation'], function($) {
console.log(Object.keys($.validator.methods).join("\n"))
});
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment