Skip to content
Draft

Forms 2 #1957

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ab8fd07
DeletePartialFormSubmissions scheduled task
duncanmcclean Jun 30, 2026
ce1ffdd
wip
duncanmcclean Jun 30, 2026
c6889d2
wip
duncanmcclean Jun 30, 2026
1e8587d
wip
duncanmcclean Jun 30, 2026
89e2121
wip
duncanmcclean Jul 1, 2026
b256404
Start documenting mult-page form features
jaygeorge Jul 3, 2026
2947de2
merge forms pro docs into main docs page
duncanmcclean Jul 3, 2026
bfa388c
Add ul ul bullet styling
jaygeorge Jul 7, 2026
713b218
ul ul bullet styling - enforce hierarchy a touch
jaygeorge Jul 7, 2026
50225f8
Forms intro
jaygeorge Jul 7, 2026
795ab3d
Merge branch '6.x' into forms-2
jaygeorge Jul 7, 2026
516ccbc
Make warning links wrapped in code black (style choice as well as acc…
jaygeorge Jul 7, 2026
e3c8a3a
Forms wip
jaygeorge Jul 7, 2026
645f751
Add some screenshots
jaygeorge Jul 8, 2026
2903581
Add some more info on form summaries
jaygeorge Jul 9, 2026
54f735c
Merge branch '6.x' into forms-2
jaygeorge Jul 9, 2026
9dea1a5
Remove stray text
jaygeorge Jul 9, 2026
a9d3e4f
Document escape for the tree view
jaygeorge Jul 10, 2026
a408e3b
Add a tip
jaygeorge Jul 10, 2026
3828192
Rearrange
jaygeorge Jul 10, 2026
bc84c9c
Merge branch '6.x' into forms-2
duncanmcclean Jul 20, 2026
ffb8bcb
update list of permissions
duncanmcclean Jul 20, 2026
adaa8ab
form access restrictions
duncanmcclean Jul 20, 2026
9590d09
address fieldtype
duncanmcclean Jul 20, 2026
4843638
forms pro also gives you >1 form
duncanmcclean Jul 20, 2026
073d427
localizing forms
duncanmcclean Jul 20, 2026
dcce1e1
`FormRestrictedException` exception thrown by `SubmitForm` action
duncanmcclean Jul 20, 2026
042aa8f
publish config during install process
duncanmcclean Jul 20, 2026
81be492
automagic forms
duncanmcclean Jul 20, 2026
013c6fd
Merge branch '6.x' into forms-2
duncanmcclean Jul 23, 2026
8aa47e7
document connections
duncanmcclean Jul 23, 2026
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
22 changes: 20 additions & 2 deletions content/collections/fieldtypes/form.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ options:
name: query_scopes
type: string
description: >
Allows you to specify a [query scope](/extending/query-scopes-and-filters#scopes) which should be applied when retrieving selectable assets. You should specify the query scope's handle, which is usually the name of the class in snake case. For example: `MyAwesomeScope` would be `my_awesome_scope`.
Allows you to specify a [query scope](/extending/query-scopes-and-filters#scopes) which should be applied when retrieving selectable forms. You should specify the query scope's handle, which is usually the name of the class in snake case. For example: `MyAwesomeScope` would be `my_awesome_scope`.
related_entries:
- fdb45b84-3568-437d-84f7-e3c93b6da3e6
- aa96fcf1-510c-404b-9b63-cea8942e1bf8
Expand All @@ -31,6 +31,8 @@ related_entries:

The Form fieldtype is gives your users a way to pick a form to include along with the current entry. How that form is implemented or shows up on the page is up to you.

Not to be confused with [form fieldtypes](/forms#form-fieldtypes) — the fields you add _inside_ a form when building it. This fieldtype is for selecting an entire form from elsewhere, like an entry.

## Data Storage

The Form fieldtype stores the `handle` of a single form as a string, or an array of handles if `max_items` is greater than 1.
Expand All @@ -45,4 +47,20 @@ The Form fieldtype provides a few useful variables:
* `api_url`
* `honeypot`

You can use the [`form:create`](/tags/form-create) tag to render a `<form>` on your page.
You can pass the `handle` to the [`{{ form:create }}`](/tags/form-create) tag to render a `<form>` on your page:

::tabs

::tab antlers
```antlers
{{ form:create :in="form_fieldtype:handle" }}
...
{{ /form:create }}
```
::tab blade
```blade
<s:form:create :in="$form_fieldtype->handle">
...
</s:form:create>
```
::
2 changes: 1 addition & 1 deletion content/collections/pages/conditional-fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,4 +382,4 @@ For more advanced conditional validation, take a look at Laravel's `required_if`

## Templating

You can take advantage of Conditional Fields on your front-end Forms to automatically generate dynamic forms and logic. [Learn more about it](/tags/form-create#conditional-fields).
You can take advantage of Conditional Fields on your front-end Forms to automatically generate dynamic forms and logic. [Learn more about it](/tags/form-create#logic-conditional-fields).
30 changes: 28 additions & 2 deletions content/collections/pages/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,18 @@ public function handle(FormBlueprintFound $event)
}
```

### FormCreated
`Statamic\Events\FormCreated`

Dispatched after a form has been created.

``` php
public function handle(FormCreated $event)
{
$event->form;
}
```

### FormCreating
`Statamic\Events\FormCreating`

Expand Down Expand Up @@ -1131,7 +1143,7 @@ public function handle(StaticCacheCleared $event)
### SubmissionCreated
`Statamic\Events\SubmissionCreated`

Dispatched after a form submission has been created. This happens after a form has been submitted on the front-end.
Dispatched after a form submission (including [partial submissions](/repositories/form-submission-repository#partial-submissions)) has been created. This happens after a form has been submitted on the front-end.

``` php
public function handle(SubmissionCreated $event)
Expand All @@ -1145,7 +1157,7 @@ If you're looking to prevent a form being submitted or trigger validation errors
### SubmissionCreating
`Statamic\Events\SubmissionCreating`

Dispatched before a submission is created. You can return `false` to prevent it from being created.
Dispatched before a submission (including [partial submissions](/repositories/form-submission-repository#partial-submissions)) is created. You can return `false` to prevent it from being created.

``` php
public function handle(SubmissionCreating $event)
Expand All @@ -1154,6 +1166,20 @@ public function handle(SubmissionCreating $event)
}
```

### SubmissionFinalized
`Statamic\Events\SubmissionFinalized`

Dispatched when a submission is finalized — either when a regular form is submitted, or when the final page of a multi-page form is submitted and its [partial submission](/repositories/form-submission-repository#partial-submissions) becomes complete.

Unlike `SubmissionCreated`, this event never fires for partial submissions, making it the best place to hook in logic that should only run once a submission is truly complete.

``` php
public function handle(SubmissionFinalized $event)
{
$event->submission;
}
```

### SubmissionDeleted
`Statamic\Events\SubmissionDeleted`

Expand Down
Loading