Commit Graph

114 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
Brahim Arkni
ef6821aba3 Core: Error hidden but input error class not removed
When a field has one rule with option `depends` specified and this
dependency mismatch, the plugin will remove it, so that field will not be
validated on submit by the the rule in question. So if that field is
already invalid, only the error message will be hidden and the error class
will remain.

This commit fixes this issue.

Fixes #1632
2016-01-07 18:12:51 +01:00
Denisson Padilha
908b3f30af Core: Remote validation uses wrong error messages
Fixes #697. Closes #1028.
2016-01-07 17:40:08 +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
Markus Staab
45f3ac25c5 Core: added doc reference to jQuery.validator.methods
Closes #1530.
2015-11-24 09:22:03 +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
Markus Staab
1289397f94 Test: fixed HTML5 step attribute tests for firefox44
firefox provides element.type==text,
since it does not support the date input type right now.
2015-11-12 10:38:42 +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
Markus Staab
5d778ee443 Merge pull request #1418 from dorner/content-editable
Add support for contentEditable tags
2015-10-30 00:05:10 +01:00
Saldanha
6f651b2212 Core: Added support for "pending" class on outstanding requests 2015-10-29 17:20:53 -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
b76c83e742 Core: Fix lint errors, add test 2015-10-28 13:40:49 -04:00
dorner
3d0cd6f2a5 Add support for contentEditable tags
Currently the validation library only works on classic form elements. However, there is no reason it can't work on rich text elements that have names and use contentEditable. This change adds support for these tags.
2015-10-28 13:40:36 -04:00
Markus Staab
a6151f9064 Merge pull request #1609 from Arkni/transformation-layer
Core: Added transformation/normalization layer
2015-10-25 20:49:35 +01:00
Brahim Arkni
abe6810444 Core: Added normalizer
The user can change the value of an element before validating
the element in question. The new value will be then used by
the associated methods instead of the `real one`.

Closes #1602
2015-10-23 20:58:36 +01:00
Brahim Arkni
f0144b56b9 Core: Split out creditcard method
As mentioned by Jörn in #1506
2015-10-21 22:48:06 +01:00
Brahim Arkni
8327818438 Core: Escape errorID for use in the regex, not to build aria-describedby
The error ID was being escaped for use in a regex, but these escaped
characters were also being passed on to the aria-describedby value
set in the HTML, which means the ID doesn't match up with the ID of
the element it's referring to.

Fixes #1523
Closes #1587
2015-10-19 16:52:16 +01:00
Brahim Arkni
10f4357f5e Core: Escape single quotes in names avoiding a Sizzle Error being thrown
When a name or ID contains single quotes, a Sizzle error will be thrown,
so to avoid that, we have to escape all single quotes in that name or ID
before using it.
2015-10-09 17:20:28 +01:00
Brahim Arkni
f3547be165 Core: Added precondition to call isValidElement method 2015-09-25 17:28:23 +01:00
Brahim Arkni
d8c92a168d Core, Ajax: Fixed spacing issues. 2015-09-25 16:54:38 +01:00
Markus Staab
4df6cb8b56 Merge pull request #1579 from Arkni/fix-1508
Fixes #1508: Validation fails to trigger when next field is already filled out
2015-09-25 15:06:07 +02:00
Markus Staab
60387834b8 Revert "Core: escape errorID only for use in the regex"
This reverts commit b2df81ccb6.
2015-09-25 10:55:12 +02:00
Markus Staab
b2df81ccb6 Core: escape errorID only for use in the regex
.. not for building `aria-describedby`
2015-09-25 10:15:12 +02: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
Christopher Bauer
17a56baa6f Core: core.js, methods.js, Fix for #1567 - jquery-validation ignores data obj when validating, incorrectly returning previous status
This change determines if either the validated element's value OR one of the data properties has changed before aborting the remote request. If your remote validation is skipped due to being dependent on the value of another field, this fixes that issue.
2015-09-11 09:07:43 -04:00
Jörn Zaefferer
bc4223806a Core: Remove unused removeAttrs method
jQuery Core supports removing space-separated attributes since 1.7,
and its not used in the plugin anyway.

Fixes #1124
2015-06-30 17:01:29 +02:00
Jörn Zaefferer
f33690b8a5 Core: Replace regex for url method
Making private IPs invalid is fine, and I've modified it to keep
allowing protocol-relative urls.

Fixes #1426
2015-06-30 16:38:27 +02:00
Jörn Zaefferer
6b0572551d Core: Remove bad url param in $.ajax, overwritten by $.extend 2015-06-30 15:18:14 +02:00
Jörn Zaefferer
328efc91a9 Core: Properly handle nested cancel submit button
Fixes #1370
Closes #1423
Closes #1490
2015-06-30 15:07:48 +02:00
Jörn Zaefferer
db877ebd27 Core: Fix indent 2015-06-30 14:58:55 +02:00
Jörn Zaefferer
515202d6cc Core: Refactor attributeRules and dataRules to share noramlizer
Closes #1391
2015-06-30 14:56:53 +02:00
Zen Chua
fa5f69c529 Core: dataRules method to convert value to number for number inputs
Updated dataRules method to convert value to number for number inputs.
Proposed fix for #1378
2015-06-30 14:42:56 +02:00
Yair Sladowsky
3c759331f5 Core: Update url method to allow for protocol-relative URLs
Closes #1510
2015-06-30 14:20:14 +02:00
Jörn Zaefferer
7e7f766c39 Core: Remove deprecated $.format placeholder
Fixes #756
2015-06-26 18:39:27 +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
Brahim Arkni
e371d3f72e Core: IE8 compatibility changed .indexOf to $.inArray
Closes #1451
2015-06-16 20:18:02 +02:00
Marek ‘saji’ Augustynowicz
c3e8f4d09e Core: Cast NaN value attributes to undefined for Opera Mini
Closes #1470
2015-06-16 20:08:28 +02:00
Jörn Zaefferer
2ad0ca82da Core: Stop trimming value inside required method
There was never much of a point anyway, and it causes problems.

Fixes #1498
2015-06-16 19:50:11 +02:00
Shimmy
f37c2d8131 Core: Use :disabled selector to match disabled elements
This also applies to elements that are inside a fieldset with a disabled
attribute, causing an inherited disabled state. Only matching the disabled
attribute directly won't capture that.

Closes #1474
2015-05-12 13:31:35 +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
Ryley Breiddal
f3b1e415cf Core: Throw better errors for bad rule methods
99% of type errors in this situation are misspelled rules, so be
specific in the throw

Closes #1395
2015-02-10 15:42:29 +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