Commit Graph

90 Commits

Author SHA1 Message Date
bytestream
0991196358 Fix: dont use self closing tag on custom-text element 2025-11-14 11:12:18 +00:00
copilot-swe-agent[bot]
0488823222 Core: Also update findByName to support form attribute
Co-authored-by: bytestream <1788397+bytestream@users.noreply.github.com>
2025-11-12 13:48:30 +00:00
copilot-swe-agent[bot]
49066adca8 Core: Add support for form attribute on elements outside form
Co-authored-by: bytestream <1788397+bytestream@users.noreply.github.com>
2025-11-12 13:44:28 +00:00
eden-jh
6eb2df0da1 Core: Unnecessary aria-describedby (#2410)
* Core: progress on removing aria-describedby from valid fields

* core: aria-describedby

* Core: remove aria-describedby when hiding error

* Core: fix syntax issues, Test: add test for new setting

* Core: Fix bugs in aria-describedby behavior and related tests

* Core: bugfix for labels without id

* Core: don't create a new error element if one exists

* Core: progress on test for group of fields with ariaDescribedbyCleanup

* Core: Groups aria-describedby

* Core: fix aria-describedby not being removed from grouped fields

Ensure that aria-describedby is removed from all members of a group when 
all the known errors are resolved

* Core: Update capitalization

* Demo: Add page for ariaDescribedByCleanup

* Core: add setting to remove aria-describedby from valid fields

Includes additional unit tests and a demo page

* Core: Fix camel case inconsistency, remove stray comment

* Update demo/css/cmxform.css

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Kieran <kieran.brahney@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-03 11:46:18 +01:00
Daniel Hobi
75f51237e4 Core: Add support for Web Components (#2493)
Co-authored-by: Daniel Hobi <daniel.hobi@swisslearninghub.com>
2024-06-28 16:10:19 +01:00
Volkan Ceylan
7a490d8f39 Core: Added escapeHtml option to avoid XSS attacks via showLabel methods (#2462) 2023-02-01 10:26:18 +00:00
Leonardo Spina
cfe74a19b6 Core: Call to resetInternals removed in remote validation callback (#2242)
* Core: Call to resetInternals removed in remote validation callback

* Core: Add unit test for issue #2150 fix

* Core: fix code style errors

Co-authored-by: leonardospina <leo@babieleo.it>
Co-authored-by: Julien Tschäppät <julien.tschappat@smartliberty.ch>
2023-01-24 11:37:07 +00:00
Warren White
13b859e357 Additional: vinUS validation fails on valid vin numbers (#2460)
* Removed === compare, changed to ==
Compare by value and type (===) does not work for this algorithm, as both cd and cdv can be either types at the same time.
By comparing by value only (==) cd and cdv can be either integer or string, as a string number will be converted to a number reqardless of type.

* Rewrote forloop, removed nested forloop

* Additional: fixed spacing issues

* Additional: Add vinUS.js validation test cases

Test cases include default test with 17 one's, and additional US and Canada VIN

* Additional: add two more test casses for vinUS

* Additional: removed text license number, should be VIN
2022-12-01 10:50:24 +00:00
João Issamu Francisco
fcf782e2c7 Additional: Add Brazillian CNH number (Carteira Nacional de Habilitacao) (#2234) 2018-11-05 20:27:34 +00:00
Cory Silva
e1f99a76ac Additional: Add ABA Routing Number Validation (#2216) 2018-10-10 10:19:45 +01:00
Brahim Arkni
bc5e651a36 Test: Cast empty data attributes to 'true' 2018-06-19 14:07:11 +01:00
Brahim Arkni
8769eab80e Test: Ignore elements that belong to other/nested forms 2018-03-04 16:20:21 +00:00
Rob Johnston
38cb9b9c8c Additional: Add greaterThan and lessThan methods. (#2061)
* Tests: Add tests for integers.

* Core: Unbind the event and remove the class name.

* Test: Test binding of blur event.

* Test: Test binding of blur event.
2017-09-19 23:21:26 +02:00
Wang Sen
2732ddb6fe Additional: add netmask validation method (#1955)
Add a method to validate netmask.

Invalidate-pull-request: #1831 #Add test cases
Signed-off-by: Wang Sen <wangsen@linux.vnet.ibm.com>
2017-04-18 12:30:18 +02:00
Brahim Arkni
ddaed1ccb5 Core: assign rules to contenteditable via .validate() and .rules() (#1947)
Fixes #1946
2017-02-14 21:36:31 +01:00
PhistucK
cce5ac8268 Core: Added support for button elements with descendants (#1901)
Non-Firefox browsers dispatch "click" on descendants of <button>, which breaks
the submitHandler logic that adds a hidden field with the name and value of the
submit button (since it is not included in the submission if it did not
initiate the submission, which might be the case when using form.submit in
submitHandler and returning false). submitButton is instead a descendant of
<button> and the hidden field does not compensate for the lack of an actual
submit button.

This would fix crbug.com/668524 and make submitButton an actual button.

* Added HTML for button with descendants test

For testing that clicking on descendants of a button element still keeps the button element as the submit button.

* Added a test for button with descendants support

For testing that clicking on descendants of a button element still
keeps the button element as the submit button.

* Removed an extraneous submission from the test

Accidental copy-paste.

* Fixed some style warning

Forgot to wrap the parenthesized value with spaces.

* Fixed a style warning

Forgot to wrap a parenthesized value with spaces.

* Fixed a style warning

Forgot to add a blank line above a comment.

* Fixed the button with descendants test

Replaced a complex event initiation with a basic click().

* Fixed a style warning

Removed extraneous trailing spaces.

* Fixed some style warnings

Removed two unused variables.

* Fixed a submitButton regression

Instead of returning a DOM element, a jQuery element was returned.
Changed to return the original element in the target is already a button case.

* Simplified the button with descendants support

Instead of looking for the parent or ancestor of the target,
just used the currentTarget property.

* Added another test

Devised by @Arkni.
2017-01-28 12:55:17 +01:00
Artem Denysov
5dee52b932 Core: add binding for input with button type. Closes #1891 2016-12-01 16:04:47 +01:00
Stéphane S
a464d86b94 Core: Support jquery3. Closes #1866 2016-12-01 15:58:52 +01:00
Brahim Arkni
8fe4a90185 Tests: Upgrade QUnit to 2.0.
Closes #1777. #1681.
2016-07-22 17:56:18 +02:00
Markus Staab
45c4b17f45 Core: Added failing test for #1805. Patch by @Arkni. 2016-07-22 16:16:56 +02:00
Torgny Bjers
cb6068110c Tests: Added regression unit tests for PR #1760
Testing small fraction steps to ensure correct modulo operation.
Cleaned up @adhayward's formatting, was using spaces instead of tabs.
2016-07-15 16:10:00 +02:00
Lars Skjelbek
e9fd71d89b Core: Unhighlighting field if already highlighted when using remote rule.
Closes #1712. Refs #1669, #1375, #12.
2016-02-19 15:52:34 +01:00
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
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
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
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
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
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
9b498e0113 Test: Added unit test that runs into the issue reported in #1523 2015-10-17 14:28:29 +01:00
Brahim Arkni
d845a33c6e Test: Added unit test runs into the error reported in #1603 2015-10-09 15:46:05 +01: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
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
a-barry
394a246d4a Core: Escape dollar sign in error id
Fix non label error elements containing $ character in the name/id
(asp.net web forms) causing syntax error in sizzlejs.

Fixes #1331
Closes #1336
2014-12-02 16:37:38 +01:00
Jörn Zaefferer
20f3e9fac9 Core: Escape id/name before using it as a selector in errorsFor
Fixes #1275
2014-09-23 13:27:51 +02:00
Lars Laade
4c8c397773 All: Remove closing slash on empty elements 2014-06-24 09:01:42 +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
paladox2015
365cc87b7e Lib: Add jQuery 1.11.1, remove the jquery.js loader in test/ 2014-06-09 21:46:59 +02:00
Nick Schonning
bfc2f43703 All: Update URLs to jqueryvalidation.org
Fixes #1123
Closes #1134
2014-05-30 11:36:10 +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
Nick Schonning
f5a7ce5f98 All: Format HTML as per jQuery style guide
Fixes #1101
Closes #1104
2014-05-06 10:35:41 +02:00
Jörn Zaefferer
a0ed6f8111 Core: Fix normalization for rangelength attribute value
This regressed at some point, probably when rules-as-data-attributes where
introduced, since those are automatically parsed as JSON. For the unprocessed
attributes, the array brackets have to be removed.

Also fixes the milk demo, which specified rangelength as the message, instead of
minlength, which it actually uses.

Fixes #1087
2014-04-29 20:41:18 +02:00
Jörn Zaefferer
e72a9b62df Test: Cleanup indent 2014-04-01 11:07:09 +02:00