Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update forms.md #379

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions content/collections/docs/forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,27 @@ name of the field by adding `honeypot: something` to your formset.

> We say the submission will "fail", but that's not **exactly** true. On the front end it will appear that the form was submitted successfully. However, nothing will get saved and no emails will be sent. This is the key to tricking bots into believing everything went smoothly.


## Form Troubleshooting {#form-troubleshooting}

Sometimes a user might decide to turn off cookies or do other bad things, like waiting for his CSRF token to expire before submitting a form.

This can lead to unexpected behavior: instead a happy green success message the user might see an error, explaining that his session (that he of course doesn't know of) just expired.

To prevent confused phone calls from rejected users you can disable the static caching for your sites that contain the form.
Edit caching.yaml:
```yaml
static_caching_exclude:
# change accordingly
- /contact
```

Or disable CSRF like this in your system.yaml:
```yaml
csrf_exclude:
- /!/Form/create
```

[rules]: https://laravel.com/docs/5.1/validation#available-validation-rules
[tags]: /tags/form
[submissions]: /tags/form-submissions