Commit Graph

103 Commits

Author SHA1 Message Date
Veres Lajos
f79e647f9f typo fixes 2013-05-08 14:35:26 +01:00
Jörn Zaefferer
493c0c3772 Bump post-release version 2013-03-22 15:19:48 +01:00
Jörn Zaefferer
3b39aec630 Release 1.11.1 2013-03-22 15:17:51 +01:00
jcbowman
10d90529c9 Revert to also converting parameters of range method to numbers. Closes gh-702
Unlike min/max, there's no range attribute in html5. For dates, min/max can be used.
2013-03-22 14:58:17 +01: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
Bogdan Litescu
4a134b6db6 Fixed 'messages' coming up as a rule and causing an exception after being updated through rules("add"). Closes gh-670, fixes #624 2013-03-20 12:49:25 +01:00
Jörn Zaefferer
d1a53b151a Move remote method down the list to run last, after all other methods applied to a field. Fixes #679 2013-03-09 14:25:24 +01:00
jzaefferer
4a51e71c6f Fix typos 2013-03-07 13:55:35 +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
Jörn Zaefferer
5973321a6e Don't use DOM attributes or properties directly, for jQuery's valHooks to apply everywhere. Fixes #44 2013-02-27 16:53:24 +01:00
Burkhard Reffeling
574934360f Deprioritised more specific validators (min, max) to not interfere with less specific ones (number, date). Closes gh-640 2013-02-27 16:10:23 +01:00
Jörn Zaefferer
456a93b003 Update to jshint 1.0.0 (grunt-jshint 0.2.0), fix the one error it points at. Small cleanup in Gruntfile.js 2013-02-27 13:11:37 +01:00
Nick Schonning
5e3a24d262 Migrate to Grunt v0.4.0
min to uglify
zip to grunt-zipstream
lint to jshint
Install grunt-cli for Travis-CI
Fix license header
2013-02-26 02:59:49 -05:00
Paul Cichonski
bcff73ad84 Bypass validation for buttons with 'formnovalidate' attribute (same as class="cancel"). Closes gh-623 2013-02-12 13:38:47 +01:00
Jörn Zaefferer
ff26f320c6 Fix post-release version 2013-02-05 10:19:27 +01:00
Jörn Zaefferer
0996fc4cf2 Bump post-release version 2013-02-04 12:24:04 +01:00
Jörn Zaefferer
8caa0b7480 Release 1.11.0 2013-02-04 12:22:06 +01:00
Alexander I. Zaytsev
69831a08cf Remove clearing as numbers of min, max and range rules. Fixes #455. Closes gh-528.
These rules are fully suitable to check any comparable JavaScript objects such as strings or dates. Also clearing prevents HTML5 date input fields to work when these rules are coming from HTML.
2013-02-04 12:11:10 +01:00
Jörn Zaefferer
a047634196 Revert back to checking for name attribute only when debug flag is set. Never throw an exception here. Fixes #621
Revert "Improve error handling when no element is missing its name attribute. Still need to set debug flag to see exception."

This reverts commit 22edeaf28f.
2013-02-04 12:02:27 +01:00
Nick Williams
856cec06b8 Update pre-existing labels - fixes #430 closes gh-436
made assumption that any existing label which already has errorClass is
safe to update with a new message.
2013-01-31 12:55:17 +01:00
Jörn Zaefferer
22edeaf28f Improve error handling when no element is missing its name attribute. Still need to set debug flag to see exception. 2013-01-31 00:44:34 +01:00
Robert
0d394a7418 Updated coding style 2013-01-31 00:29:28 +01:00
Jörn Zaefferer
2b1b2563c5 Fix $.validator.format to avoid group interpolation, where at least IE8/9 replaces -bash with the match. Fixes #614 2013-01-31 00:12:32 +01:00
Jörn Zaefferer
315189301a Add plugin manifest and update headers to just MIT license, drop unnecessary dual-licensing (like jQuery). 2013-01-22 22:21:43 +01:00
IamDavidovich
b82d8cc1db Allow groups to be an array or a string - Fixes #479
Field names can contain spaces (as they are a CDATA type). This causes problems with groups, as the string listing the fields is split on spaces.

This commit allows the groups option to be either a space-separated string or an array of strings so that field names with spaces can be added. It also adds a unit test to ensure that both string and array based groups are processed into the same data structures.
2012-12-10 12:59:37 +01:00
Jörn Zaefferer
3d02806333 Whitespace/indent fixes 2012-11-26 13:50:28 +01:00
Synchro
acc96f9e17 Some minor cleanups of things flagged by static analyser in PHPStorm 2012-11-26 13:31:44 +01:00
Max Lynch
6df33a8ccc Remove support for metadata plugin, replace with data-rule- and data-msg- (added in 907467e8) properties. 2012-11-23 14:39:37 +01:00
Mischa Sameli
948c7cedcd Added sftp as a valid url-pattern 2012-11-23 13:42:09 +01:00
mlwalt
78859d9e75 Remove focusin/focusout polyfill. Fixes #542 - Inclusion of jquery.validate interfers with focusin and focusout events in IE9
Removed polyfill for focusin and focusout events as this implementation is problematic in IE9, and jQuery core has handled them since 1.4 (1.8.2 is the latest at this point in time). Note that this raises the minimum compatibility of the validation plugin to jQuery 1.4.
2012-11-14 11:29:28 +01:00
Pierre-Antoine Passet
61e7816a9c Fixed premature return in remote function which prevented ajax call from being made in case an input was entered too quickly. Ensures remote validation always validates the newest value. 2012-10-14 09:32:03 -04:00
Jörn Zaefferer
5934f4d450 Undo fix for #244. Fixes #521 - E-mail validation fires immediately when text is in the field. 2012-10-03 18:41:25 +02:00
Jörn Zaefferer
64e806b462 Bump post release version 2012-09-07 13:15:08 +02:00
Jörn Zaefferer
ec9c676972 Release 1.10.0 2012-09-07 13:14:24 +02:00
Jörn Zaefferer
4290ab518f Lint 2012-09-06 13:06:58 +02:00
Max Lynch
907467e874 Merged in changes for specifying custom error messages in data attributes 2012-05-15 17:39:40 -05:00
Max Lynch
a8568232a6 Add element to success call with test. Fixes #60 2012-05-07 11:30:10 +02:00
Max Lynch
f0b8042233 resetForm now clears old previousValue on form elements. Fixes #312 2012-05-04 10:48:49 -05:00
Max Lynch
a24e58a293 Fixed dataFilter response issues in jQuery 1.5.2+. Fixes #405 2012-05-04 11:13:06 +02:00
Max Lynch
9b964ee920 Deoptimize findByName for correctness. Fixes #82 - $.validator.prototype.findByName breaks in IE7 2012-05-02 13:16:30 +02:00
Max Lynch
c41f2f616d Changed lastElement to lastActive in keyup, skip validation on tab or empty element. Fixes #244 2012-04-28 16:58:34 +02:00
Max Lynch
7cc01adbd1 Fixed invalid count on invalid to valid remote validation. Fixes #286 2012-04-28 16:41:28 +02:00
Max Lynch
b475b483f5 Moved old accept method to extension additional-method, added new accept method to handle standard browser mimetype filtering. Fixes #287 and supersedes #369 2012-04-22 23:37:01 -05:00
Max Lynch
aca144b5eb Disables blur event when onfocusout is set to false. Test added. 2012-04-20 15:11:34 +02:00
Max Lynch
58930870c6 Fixed value issue for radio buttons and checkboxes. Fixes #363 2012-04-20 15:09:15 +02:00
Max Lynch
a436634fe8 Added pseudo selector for text input types to fix issue with default empty type attribute. Added tests and some test markup. Fixes #217 2012-04-18 00:14:33 +02:00
Max Lynch
f1f97e5947 Removed incorrect false check on required attribute 2012-04-04 13:32:12 -05:00
Max Lynch
e036239746 required attribute fix for non-html5 browsers. Fixes #301 2012-04-04 19:01:56 +02:00
Max Lynch
f2d525c919 Fixed regex issue for decimals without leading zeroes. Added new methods test. Fixes #41 2012-04-03 12:00:03 +02:00
Max Lynch
e30b3aab02 Introduce a elementValue method that normalizes only string values (don't touch array value of multi-select). Fixes #116 2012-04-02 15:04:56 +02:00