Skip to content

Commit

Permalink
Document repopulation of form data
Browse files Browse the repository at this point in the history
  • Loading branch information
bjuppa committed May 6, 2019
1 parent 178d8d9 commit bc71118
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,10 @@ This is actually a good pattern for scoping variables to one of the forms on you
@include('my_form_partial', ['errors' => $errors->my_form_bag, 'model' => $user])
```

If the `$errors` bag contains any errors,
[old input data from the previous request](https://laravel.com/docs/5.8/helpers#method-old)
will be used to repopulate the form.

The `id` attribute is set automatically on created elements that need it,
and it's usually derieved from the `$name` variable.
If you get an id conflict on a page where two inputs may have the same name,
Expand Down

0 comments on commit bc71118

Please sign in to comment.