Skip to content

Commit

Permalink
feat(form): support id only input fields for validation
Browse files Browse the repository at this point in the history
Form validation always assumes/requires a name property on each input field to work. While this is fine for "real" forms which are supposed to send data to a server, a pure div form or local validation only logic without using name (but id) properties did not work.
  • Loading branch information
lubber-de authored Dec 2, 2023
1 parent 4bdf123 commit 0c7e318
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/definitions/behaviors/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@
var
$field = $(field),
$calendar = $field.closest(selector.uiCalendar),
name = $field.prop('name'),
name = $field.prop('name') || $field.prop('id'),
value = $field.val(),
isCheckbox = $field.is(selector.checkbox),
isRadio = $field.is(selector.radio),
Expand Down

0 comments on commit 0c7e318

Please sign in to comment.