Skip to content

Commit ea51d83

Browse files
committed
Form: does not show 'no associated handlers' error if the form is not submitted by the button
https://forum.nette.org/cs/34670-user-warning-form-was-submitted-but-there-are-no-associated-handlers#p226590
1 parent 0b29dfb commit ea51d83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Forms/Form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ public function fireEvents(): void
490490
$this->validate();
491491
}
492492

493-
$handled = count($this->onSuccess ?? []) || count($this->onSubmit ?? []);
493+
$handled = count($this->onSuccess ?? []) || count($this->onSubmit ?? []) || $this->submittedBy === true;
494494

495495
if ($this->submittedBy instanceof Controls\SubmitButton) {
496496
$handled = $handled || count($this->submittedBy->onClick ?? []);

0 commit comments

Comments
 (0)