Skip to content

Commit 932fc34

Browse files
committed
netteForms.js: ignore fieldsets (and eventually other non-control elements) in form.elements
1 parent 5f16526 commit 932fc34

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/assets/netteForms.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,10 @@ Nette.validateForm = function(sender) {
164164
for (i = 0; i < form.elements.length; i++) {
165165
elem = form.elements[i];
166166

167-
if (elem.type === 'radio') {
167+
if (elem.tagName && !(elem.tagName.toLowerCase() in {input: 1, select: 1, textarea: 1, button: 1})) {
168+
continue;
169+
170+
} else if (elem.type === 'radio') {
168171
if (radios[elem.name]) {
169172
continue;
170173
}

0 commit comments

Comments
 (0)