diff --git a/src/Form.php b/src/Form.php index 2a72e4cbf9..58528140f4 100644 --- a/src/Form.php +++ b/src/Form.php @@ -135,7 +135,7 @@ protected function init(): void parent::init(); $this->formElement = View::addTo($this, ['element' => 'form', 'shortName' => 'form'], ['FormElementOnly']); - $this->on('submit', new JsExpression('if (event.target === this) { []; }', [$this->js(false, null, $this->formElement)->form('submit')])); + $this->on('submit', new JsExpression('if (event.target === this) { []; }', [$this->formElement->js()->trigger('submit')])); $this->initLayout();