Skip to content
Snippets Groups Projects
Commit 8bc807fb authored by a.muntian's avatar a.muntian
Browse files

magento/magento2#6113: Validate range-words in Form component (UI Component)

- Changed range-words validation logic
parent 465e14bd
Branches
No related merge requests found
...@@ -84,8 +84,10 @@ define([ ...@@ -84,8 +84,10 @@ define([
], ],
'range-words': [ 'range-words': [
function (value, params) { function (value, params) {
return utils.stripHtml(value).match(/\b\w+\b/g).length >= params[0] && var match = utils.stripHtml(value).match(/\b\w+\b/g) || [];
utils.stripHtml(value).match(/\b\w+\b/g).length < params[1];
return match.length >= params[0] &&
match.length <= params[1];
}, },
$.mage.__('Please enter between {0} and {1} words.') $.mage.__('Please enter between {0} and {1} words.')
], ],
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment