diff --git a/src/AdamWathan/Form/FormBuilder.php b/src/AdamWathan/Form/FormBuilder.php index 3dd6ec7..21507ce 100644 --- a/src/AdamWathan/Form/FormBuilder.php +++ b/src/AdamWathan/Form/FormBuilder.php @@ -227,7 +227,7 @@ public function bind($model) public function getValueFor($name) { - if ($this->hasOldInput()) { + if ($this->hasOldInputFor($name)) { return $this->getOldInput($name); } @@ -238,6 +238,19 @@ public function getValueFor($name) return null; } + protected function hasOldInputFor($name) + { + if(! $this->hasOldInput()) { + return false; + } + + if(! $this->getOldInput($name)) { + return false; + } + + return true; + } + protected function hasOldInput() { if (! isset($this->oldInput)) {