Skip to content

Commit 0c7e318

Browse files
authored
feat(form): support id only input fields for validation
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.
1 parent 4bdf123 commit 0c7e318

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/definitions/behaviors/form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@
711711
var
712712
$field = $(field),
713713
$calendar = $field.closest(selector.uiCalendar),
714-
name = $field.prop('name'),
714+
name = $field.prop('name') || $field.prop('id'),
715715
value = $field.val(),
716716
isCheckbox = $field.is(selector.checkbox),
717717
isRadio = $field.is(selector.radio),

0 commit comments

Comments
 (0)