Commit Graph

283 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
bytestream
e7e33a728f Revert: "Tests: Add assertion to check form exists before validating"
This reverts commit e3c28f7912.
2025-11-14 11:12:10 +00:00
copilot-swe-agent[bot]
e3c28f7912 Tests: Add assertion to check form exists before validating
Co-authored-by: bytestream <1788397+bytestream@users.noreply.github.com>
2025-11-12 15:49:00 +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
Christopher Stieg
e837cc49be Core: Allow negative decimal with no 0 (#2483)
* Core: Allow negative decimal with no 0

* Update regex

---------

Co-authored-by: METALCOMPINC\cstieg <cstieg@metalcompinc.com>
Co-authored-by: Kieran <kieran.brahney@gmail.com>
2024-06-29 11:11:15 +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
Sylvain Monné
569e62234c Core: fix remote validation when input is the same as in aborted request (#2481)
Fixes #2479
2024-04-21 09:59:31 +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
Sylvain Monné
98fbc5f428 Core: remove pending class from fields with an aborted request (#2436)
Ref #2434
Ref #2435

Co-authored-by: Sylvain Monné <sylvain@monne.me>
2022-07-17 12:21:36 +01:00
Sylvain Monné
980087a897 Core: fix race condition in remote validation rules (#2435)
Fixes #2434

Co-authored-by: Sylvain Monné <sylvain@monne.me>
2022-07-15 22:26:56 +01:00
Kieran
5bbd80d27f Merge pull request from GHSA-ffmh-x56j-9rc3
(cherry picked from commit a3908cc082465000a3afa4bed47418b6e02c14ed)
2022-07-01 17:00:37 +02:00
Kieran
69cb17ed77 Core: fix ReDoS vulnerability in url2 (#2428) 2022-05-19 16:20:09 +01:00
Artyom Skrobov
350f6aea8b Core: fix validation for input type="date" (#2360)
* Core: Fix code style to pacify jscs

* Core: Fix validation for input type="date" (#2359)

Test case contributed by @nenadvicentic

Co-authored-by: Kieran <kieran@supportpal.com>
2022-05-06 11:26:19 +01:00
Kieran
eb88df0e63 Core: wait for pendingRequests to finish before submitting form (#2369) 2022-04-04 14:29:44 +02:00
Tim Gates
b9c793c90b docs: Fix simple typo, atteched -> attached (#2345)
There is a small typo in test/test.js.

Should read `attached` rather than `atteched`.
2020-09-05 08:19:38 +02:00
jehadja
3242f0f3e7 Additional: Add validation rule for mobile number of Russia Federation (#2207) 2018-11-06 19:53:31 +00:00
Julio Spader
743077cf29 Additional: Add Brazillian CNPJ validation rule (#2222) 2018-11-05 20:59:39 +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
Cleiton da Silva Mendonça
01ce49cf36 Additional: Add Brazillian PIS/NIS number validation method (#2204) 2018-08-21 14:04:07 +01:00
Brahim Arkni
2037129e00 Core: Don't call submitHandler when in debug mode (#2193)
Fixes #2042
2018-07-29 15:58:24 +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
Keith Morrison
fc25612ef0 Additional: allow N11 exchange for non-geo US phone. Fixes #1695 (#2098) 2018-02-14 09:04:06 +01:00
Lukasz
de806ce0f0 Test: Add tests for phonePL method 2018-02-13 22:57:53 +00:00
Rob Johnston
5ecd6c261f Additional: Add new BIN range for MasterCard. (#2088)
Fixes #1904
2017-10-09 13:46:58 +01:00
Rob Johnston
7e9e4788bf Additional: max size and number of files (#2087)
This commit contains:

* Validate max number and size of file(s).
* Add tests for max number and size of file(s).
2017-10-08 21:25:24 +01: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
Brahim Arkni
5482dfd95f Test: Add missing description to a test (#2055) 2017-09-02 18:52:03 +01:00
Brahim Arkni
18b8497db4 Test: required method should return false for null & undefined values 2017-09-02 18:27:51 +01:00
Brahim Arkni
cac8f05e6b Core: Allow the normalizer to return any value
Fixes #2049
2017-09-02 17:43:15 +02:00
Brahim Arkni
16227e4087 Tests: Pass on the value of the used submit button for scripted submits
The only scripted submits in this plugin are triggered by `stopRequest()`
when the remote method finished validating an element and the form was
submitted
2017-06-26 15:54:52 +02:00
Brahim Arkni
b0805c3e3f Tests: Use assert#pushResult instead of assert#push
assert#push has been deprecated and will be removed in
QUnit 3.0.0
2017-06-23 18:42:25 +00:00
Alex Bokii
54073af109 Core: removed aria-required attribute (#2012)
Fixes #1841
2017-06-12 15:50:57 +00: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
Dominik Krzywiecki
31176a239a Additional: Polish tax id validation method (#1850) 2017-02-11 20:58:56 +01:00
Brahim Arkni
6781d94ed2 Core: count invalid fields with empty message in numberOfInvalids() (#1942)
Fixes #1922
2017-02-11 18:02:00 +01:00
Markus Staab
bb0c335c7a Tests: removed duplicated test (#1931) 2017-01-30 21:10:39 +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
jarey
7457cc6401 Additional: Fixed validation for specific case for Spanish NIFs. (#1914) 2017-01-28 12:48:57 +01:00
Brahim Arkni
a88ae88c6e Core: Add support for defining a global normalizer 2016-12-25 16:12:45 +01:00
Alfonso Martin
e7422d6d1e Additional: Refine cifES and nieES algorithms (#1826) 2016-12-01 16:15:22 +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