Skip to content

Commit

Permalink
netteForms.js: validity of input=number is checked in 'onlyCheck' mode
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Aug 15, 2016
1 parent 5b73174 commit fce5b4d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/assets/netteForms.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,10 @@ Nette.validateControl = function(elem, rules, onlyCheck, value, emptyOptional) {
}
}

if (!onlyCheck && elem.type === 'number' && !elem.validity.valid) {
Nette.addError(elem, 'Please enter a valid value.');
if (elem.type === 'number' && !elem.validity.valid) {
if (!onlyCheck) {
Nette.addError(elem, 'Please enter a valid value.');
}
return false;
}

Expand Down

0 comments on commit fce5b4d

Please sign in to comment.