Skip to content

Commit 897e398

Browse files
committed
Validation exception can be rendered only if a form field exists
1 parent 745e01e commit 897e398

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Form.php

+4
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,10 @@ public function onSubmit(\Closure $callback)
259259
} catch (ValidationException $e) {
260260
$response = [];
261261
foreach ($e->errors as $field => $error) {
262+
if (!isset($this->controls[$field])) {
263+
throw $e;
264+
}
265+
262266
$response[] = $this->error($field, $error);
263267
}
264268

0 commit comments

Comments
 (0)