Skip to content
Open
Show file tree
Hide file tree
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
22 changes: 11 additions & 11 deletions docs/guide/forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default () => (

Just like a traditional HTML form, there is no need to attach an `onChange` handler to your input fields, just give each input a `name` attribute and a `defaultValue` (if applicable) and the `Form` component will handle the data submission for you.

== Svelte 4 | Svelte 5
== Svelte 4| Svelte 5

```svelte
<script>
Expand All @@ -62,7 +62,7 @@ Just like a traditional HTML form, there is no need to attach an `onChange` hand
</Form>
```

Just like a traditional HTML form, there is no need to attach a `bind:` to your input fields, just give each input a `name` attribute and the `Form` component will handle the data submission for you.
Just like a traditional HTML form, there is no need to attach a `bind:` to your input fields, just give each input a `name` attribute and a `defaultValue` (if applicable, available since Svelte `5.6.0`) and the `Form` component will handle the data submission for you.

:::

Expand Down Expand Up @@ -94,7 +94,7 @@ The component also supports advanced use cases, including nested data structures
</Form>
```

== Svelte 4 | Svelte 5
== Svelte 4| Svelte 5

```svelte
<Form action="/reports" method="post">
Expand Down Expand Up @@ -138,7 +138,7 @@ You can pass a `transform` prop to modify the form data before submission. This
</Form>
```

== Svelte 4 | Svelte 5
== Svelte 4| Svelte 5

```svelte
<Form
Expand Down Expand Up @@ -433,7 +433,7 @@ Some props are intentionally grouped under `options` instead of being top-level

When setting the `disableWhileProcessing` prop, the `Form` component will add the `inert` attribute to the HTML `form` tag while the form is processing to prevent user interaction.

== Svelte 4 | Svelte 5
== Svelte 4| Svelte 5

```svelte
<Form
Expand Down Expand Up @@ -629,7 +629,7 @@ To reset the form after a successful submission:
</Form>
```

== Svelte 4 | Svelte 5
== Svelte 4| Svelte 5

```svelte
<!-- Reset the entire form on success -->
Expand Down Expand Up @@ -689,7 +689,7 @@ To reset the form after errors:
</Form>
```

== Svelte 4 | Svelte 5
== Svelte 4| Svelte 5

```svelte
<!-- Reset the entire form on success -->
Expand Down Expand Up @@ -737,7 +737,7 @@ The `Form` component provides the `setDefaultsOnSuccess` attribute to set the cu
</Form>
```

== Svelte 4 | Svelte 5
== Svelte 4| Svelte 5

```svelte
<Form action="/users" method="post" setDefaultsOnSuccess>
Expand Down Expand Up @@ -777,7 +777,7 @@ The `<Form>` component supports dotted key notation for creating nested objects
</Form>
```

== Svelte 4 | Svelte 5
== Svelte 4| Svelte 5

```svelte
<Form action="/users" method="post">
Expand Down Expand Up @@ -828,7 +828,7 @@ If you need literal dots in your field names (not as nested object separators),
</Form>
```

== Svelte 4 | Svelte 5
== Svelte 4| Svelte 5

```svelte
<Form action="/config" method="post">
Expand Down Expand Up @@ -907,7 +907,7 @@ export default function CreateUser() {
}
```

== Svelte 4 | Svelte 5
== Svelte 4| Svelte 5

```svelte
<script>
Expand Down
6 changes: 3 additions & 3 deletions docs/guide/prefetching.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ import { Link } from '@inertiajs/react'
<Link href="/dashboard" prefetch cacheTags={['dashboard', 'stats']}>Dashboard</Link>
```

== Svelte 4 | Svelte 5
== Svelte 4| Svelte 5

```svelte
import {inertia} from '@inertiajs/svelte'
Expand Down Expand Up @@ -421,7 +421,7 @@ export default () => (
)
```

== Svelte 4 | Svelte 5
== Svelte 4| Svelte 5

```svelte
<script>
Expand Down Expand Up @@ -471,7 +471,7 @@ function submit(e) {
}
```

== Svelte 4 | Svelte 5
== Svelte 4| Svelte 5

```svelte
import { useForm } from '@inertiajs/svelte'
Expand Down