Commit Graph

87 Commits

Author SHA1 Message Date
Wojciech Wałek
4101b898c0 Core: Adding a way to pass method name to remote
Closes #1657.

This allows reusing remote as custom method via addMethod
2016-02-01 09:12:47 +01:00
Brahim Arkni
7d74fc4157 Core: Validation fails to trigger when next field is already filled out
This change fix the bug when used with remote rule, it's already fixed
with other rules in commit 737630e788

Ref #1508
2016-01-18 15:25:23 +00:00
Brahim Arkni
40dae365ed Core: Required rule take precedence over number & digits rules
Ref #1611
Ref #1663
Fixes #1514
2016-01-11 09:28:06 +01:00
Lukasz Wozniak
4ebe40d1b2 Core: Fixed field highlighting with remote validation.
Prevent remote validation from removing highlight from other invalid fields.
Closes #1584.
2016-01-07 17:29:42 +01:00
KJ
bd45147a0e Core: Fixed :filled selector for multiple select elements. closes #1661, #1662. 2015-12-10 10:57:47 +01:00
Brahim Arkni
a3cc0c0a70 Core: move message processing from formatAndAdd to defaultMessage
Fixes #741. Closes #1644.
2015-11-24 09:16:18 +01:00
Brahim Arkni
43ffa81180 Core: errorList should contain only the errors that it should
When using the `valid` method on a list of inputs and there is an ignored
input in that list, the errorList is not cleared causing it to slowly
growing larger and larger when calling `valid` several times.

Fixes #1618
2015-11-24 09:13:18 +01:00
Brahim Arkni
a336e14755 Core: Extract the file name without including "C:\fakepath\"
For historical reasons, the value IDL attribute prefixes the file name
with the string "C:\fakepath\". As a result of this,
this fix will extract the file name from the value IDL attribute in a
backwards-compatible way.

For more details, see:
 - http://www.w3.org/TR/html5/forms.html#dom-input-value-filename
 - http://www.w3.org/TR/html5/forms.html#fakepath-srsly

Fixes #1615
2015-11-19 21:45:42 +00:00
unknown
792dad3539 Tests: new test for Step exception logic added 2015-11-12 10:15:20 +01:00
Filip Mares
b3c07e3957 Core: HTML5 step attribute support. Fixes #1295 2015-11-12 10:14:36 +01:00
Brahim Arkni
729823a807 All: Fixed code style issues 2015-10-30 23:55:26 +00:00
Daniel Orner
9f5b654cb3 Core: Another whitespace fix 2015-10-28 16:57:48 -04:00
Daniel Orner
b0ac381564 Core: Fix more whitespace 2015-10-28 13:40:50 -04:00
Daniel Orner
4c2f5fdf49 Core: Fix whitespace 2015-10-28 13:40:50 -04:00
Daniel Orner
32dea705b3 Core: Fix grunt errors 2015-10-28 13:40:49 -04:00
Daniel Orner
b76c83e742 Core: Fix lint errors, add test 2015-10-28 13:40:49 -04:00
Brahim Arkni
d845a33c6e Test: Added unit test runs into the error reported in #1603 2015-10-09 15:46:05 +01:00
Brahim Arkni
842e7ff5dd Test: Fix misuse of equal method & some spacing issues. 2015-09-25 16:54:38 +01:00
Brahim Arkni
cd4385572b Test: Fixed wrong order of parameters of the equal method 2015-09-23 22:49:00 +01:00
Brahim Arkni
737630e788 Core: Validation fails to trigger when next field is already filled out
Closes #494
Fixes #1508
2015-09-16 15:48:42 +01:00
Jörn Zaefferer
72217266b6 Tests: Fix lint issues 2015-06-30 16:20:04 +02:00
Jörn Zaefferer
515202d6cc Core: Refactor attributeRules and dataRules to share noramlizer
Closes #1391
2015-06-30 14:56:53 +02:00
David Weston
747890974c Core: Use jQuery 1.7+ on/off, add destroy method
Replaces validateDelegate method with jQuery's on() method. This raises
the minimum supported jQuery version to 1.7.0, dropping support for 1.6.

Closes #1392
2015-06-17 13:21:11 +02:00
Markus Staab
d937c3198c Tests: Dropped obsolete timeouts, speeding up test runtime.
Fixes #1343
Closes #1496
2015-06-16 19:57:15 +02:00
Brahim Arkni
63cb473c21 Core: Exclude some keyboard keys to prevent revalidating the field
Avoid revalidate the field when pressing one of the following keys
 in 'onkeyup' method:
	Shift       => 16
	Alt         => 18
	Caps lock   => 20
	End         => 35
	Home        => 36
	Left arrow  => 37
	Up arrow    => 38
	Right arrow => 39
	Down arrow  => 40
	Insert      => 45
	Num lock    => 144
	AltGr key   => 225

This helps especially with the remote method, which has a lot of
overhead.

Closes #1411
2015-02-24 19:40:35 +01:00
Markus Staab
64d6d7f751 Core: Do not search the whole DOM for radio/checkbox elements
Fixes #1056
Closes #1064
2015-02-17 12:21:34 +01:00
Jörn Zaefferer
7a632246be Tests: Replace jQuery#size() with #jQuery.length
Apparently newer jQuery versions are removing size(), since length has
been around fover, use that instead.
2015-02-10 20:17:27 +01:00
James
e88f2ef98a Revert "Core: Ignore readonly as well as disabled fields."
This reverts commit 9f4ba10ea7.

Closes #1383
Closes #1300
Ref #1261
2015-01-29 12:19:26 +01:00
Maks3w
a6c2a81d7f Core: Focus invalid element when validating a custom set of inputs
Invalid element is not focused when validate a custom set of inputs and
the last one is a valid input. The issue is element method, via
prepareElement method, via reset method, resets errorList state after
validate each input so the global state of the validator is not
preserved.

Closes #1327
2014-12-16 16:03:49 +01:00
Maks
535033dbd4 Core: Reset element styles when using custom highlight methods
When use a custom highlight functions which for example place the error
class in a different element (like Bootstrap form-group wrapper) this
element are not unhighlighted after resetForm.

Closes #1323
2014-12-02 17:38:58 +01:00
colemanw
9f4ba10ea7 Core: Ignore readonly as well as disabled fields.
Closes #1261
Closes #1262
2014-09-23 13:50:32 +02:00
Jörn Zaefferer
f1c611ed7a Core: Apply ignore setting to all validationTargetFor elements
Previously the filter only applied to checkables. Adds a test and moves
an existing valid() test closer to the others.

Ref #156
Closes #468
2014-09-23 12:23:37 +02:00
Damian Mooyman
ea22f54348 Core: Respect non-error aria-describedby and empty hidden errors
Ref #1083
Closes #1140
2014-06-23 11:17:35 +02:00
Lars Laade
32087b66e6 Test: added click on radio/checkbox test 2014-06-11 23:42:42 +02:00
Nick Schonning
d0c56e005e Build: Run JSCS against tests 2014-05-27 00:08:54 -04:00
Lars Laade
cda5efa487 Core: Added radio/checkbox to delegate click-event
Reverts the accidental change from d319a0da35,
where these event handlers were dropped.

Closes #1126
2014-05-23 14:17:35 +02:00
Damian Mooyman
e5e70b1632 Core: Use aria-describedby for non-label elements
Fixes #900
Closes #1083
2014-05-21 11:39:51 +02:00
Markus Staab
d319a0da35 Core: Register focusin, focusout and keyup also on radio/checkbox
Fixes #1062
Closes #1065
2014-05-20 15:54:26 +02:00
Markus Staab
104e8efceb Tests: Use asyncTest() method, replacing test() and stop() calls
Closes #1097
2014-04-29 17:56:41 +02:00
Nic Jansma
9dc0d1dd94 Core: Allow attributes to have a value of zero (eg min='0')
Closes #1029
Closes #930
Fixes #854
2014-03-12 11:34:02 +01:00
Nick Schonning
3e09fcb719 JSHint: Apply onevar to tests 2014-01-23 18:14:23 -05:00
Nick Schonning
313fd1dd3f JSHint: Remove unused parameters
- Fix double quoting in mockjax response to use doublequotes again
2014-01-23 17:45:37 -05:00
Nick Schonning
3d6f596485 JSHint: Replace braces with dot notation 2014-01-23 16:23:10 -05:00
Nick Schonning
91fa266cfe JSHint: Replace single for double quotes in tests 2014-01-23 16:16:53 -05:00
ruado1987
a86421131e Core: Ignore events on ignored elements
When an ignored element produces a blur event, it causes the valid() method to
return the wrong value.

Fixes gh-700
Closes gh-705
2014-01-14 17:54:51 +01:00
Andrew Ray
f93e1deb48 Core: Trigger success on optional but have other successful validators
The comment in the code itself says "when there are no other rules" but does
nothing to enforce that comment.

Fixes gh-851
Closes gh-852
2014-01-14 16:36:29 +01:00
magic.xie
c1f0baf36c Core: Fix support for multiple error classes
String#replace with a string argument replaces just once, not all matches.

Closes gh-884
2014-01-14 16:21:27 +01:00
Jörn Zaefferer
6f268031af valid(): Check all elements. Fixes #791 - valid() validates only the first (invalid) element 2013-06-24 14:59:22 +02:00
Erik van Konijnenburg
5b114e10db Fix min/max validation. Closes gh-666. Fixes #648
In 1.10.0, min/max validation was supported for input type="text",
where min/max were interpreted as numbers.  This means min/max
for date would not work: min="2012-02-13" was interpreted as min="Not a Number".

In 1.11.0, min/max were no longer converted to numbers.  This means
min/max for dates worked, but min/max for numbers failed:
"50" < "150" < "1000" does not hold.

For an example, see http://jsbin.com/awokex/3

This commit makes the behaviour of min/max dependent on input type:

 * input type=text (or not type attribute) has numeric min/max, as in 1.10.0
 * input type=date has working min/max for type date;
   on mobile browsers you also get a date picker,
   plus the browser may reject invalid dates before
   javascript gets a chance to complain.
 * input type=number or range get numeric min/max,
   plus numeric keypad or slider on mobile browsers,
   plus browser may reject invalid input before javascript
   gets a chance to complain

Allowing use of min/max with type=number/range/date is important
for mobile browsers, where the numeric keypad or date picker
make the input much easier to use than a generic text input field.
In this situation jquery-validate remains necessary to support
older browsers that do not do input validation based on type
and min/max.

For situations where numeric input should be validated by jquery
without giving the browser a chance to validate the input format,
input type=text in combination with min/max can be used, as in 1.10.0.
2013-03-20 13:17:58 +01:00
Jörn Zaefferer
93bab6e916 Make valid() return a boolean instead of 0 or 1. Fixes #109 - valid() does not return boolean value 2013-02-28 16:17:43 +01:00