Skip to content

Commit 2dc60d6

Browse files
authored
fix bug when multiple form on page
1 parent 99fb45e commit 2dc60d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Form/Element.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct($name, $validators = '', Form $form = null)
4141
{
4242
$oldValue = request()->old($this->name, false);
4343
}
44-
$this->hasOldValue = $oldValue !== false;
44+
$this->hasOldValue = $isFormSubmitted && $oldValue !== false;
4545
$this->error = null;
4646
$errors = session()->get('errors');
4747

0 commit comments

Comments
 (0)