Skip to content

Commit df1f2f1

Browse files
author
Tom Hanoldt
committed
typos
1 parent 221f9b5 commit df1f2f1

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@ validator = $('body').inputValidator({
2626
...
2727
});
2828

29-
$('form').inputValidator().validate()
29+
errors = $('form').inputValidator().validate()
3030
$('form').inputValidator().reset()
3131

32+
errors = validator.validate($('form'))
33+
validator.reset($('form'))
34+
3235
errors = validator.validateElement('<input type="email" value"invalid">')
3336
errors = validator.validateElement('<input type="number" value"invalid">')
3437
errors = validator.validateElement('<input type="tel" value"invalid">')
@@ -167,7 +170,7 @@ It also exposes the class `InputValidator` for manual instantiating.
167170
## Changelog
168171
### 1.0.1
169172
* readme
170-
173+
171174
### 1.0.0
172175
* initial
173176

src/input.validator.coffee

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,12 @@ class @InputValidator
166166
}
167167

168168
if errors.length > 0
169-
$element.attr('invalid', true)
169+
$element.data('invalid', true)
170170
@config.handler.onInvalidIntern(@, $element, value, errors)
171171
$element.first().focus() if @config.focusInvalidElement
172172

173173
else
174-
$element.attr('invalid', false)
174+
$element.data('invalid', false)
175175
@config.handler.onValidIntern(@, $element, value, errors)
176176

177177
errors

0 commit comments

Comments
 (0)