Commit Graph

115 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Brahim Arkni
5482dfd95f Test: Add missing description to a test (#2055) 2017-09-02 18:52:03 +01: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
Brahim Arkni
ddaed1ccb5 Core: assign rules to contenteditable via .validate() and .rules() (#1947)
Fixes #1946
2017-02-14 21:36:31 +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
Artem Denysov
5dee52b932 Core: add binding for input with button type. Closes #1891 2016-12-01 16:04:47 +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
Brahim Arkni
74b38e9db5 Core: Fix regressions introduced in #1644 and #1657. Closes #1800.
As of now the signature of `validator.defaultMessage( element, string )`
is deprecated. Use `validator.defaultMessage( element, object )` instead
where objet is defined as
```
object = {
   method: "method name",
   parameters: "the given method parameters"
}
```
2016-07-15 16:22:17 +02:00
Brahim Arkni
b106d39c16 Core: Call errorPlacement in validator scope
Fixes #1542. Closes #1780.
2016-06-14 17:13:55 +02:00
svrx
73c173198c Core: Fixed issue with contenteditable elements in forms where events for single input validation would cause exceptions.
Fixes #1729. Closes #1785.
2016-05-28 12:41:33 +02:00
Brahim Arkni
f07a267d1e Core: resetForm should also remove valid class from elements
Closes #1708
2016-02-24 17:42:40 +01: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
Brahim Arkni
ef223608a3 Core: Bind the blur event just once in equalTo rule
bind the event just once, avoiding the unbind-rebind overhead.
Also, unbind it when destroying the plugin.

Ref #1704
Ref #1707
2016-02-12 16:50:34 +00: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
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