You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/forms.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ export default () => (
48
48
49
49
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.
50
50
51
-
== Svelte 4| Svelte 5
51
+
== Svelte 4| Svelte 5
52
52
53
53
```svelte
54
54
<script>
@@ -62,7 +62,7 @@ Just like a traditional HTML form, there is no need to attach an `onChange` hand
62
62
</Form>
63
63
```
64
64
65
-
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.
65
+
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.
66
66
67
67
:::
68
68
@@ -94,7 +94,7 @@ The component also supports advanced use cases, including nested data structures
94
94
</Form>
95
95
```
96
96
97
-
== Svelte 4| Svelte 5
97
+
== Svelte 4| Svelte 5
98
98
99
99
```svelte
100
100
<Form action="/reports" method="post">
@@ -138,7 +138,7 @@ You can pass a `transform` prop to modify the form data before submission. This
138
138
</Form>
139
139
```
140
140
141
-
== Svelte 4| Svelte 5
141
+
== Svelte 4| Svelte 5
142
142
143
143
```svelte
144
144
<Form
@@ -433,7 +433,7 @@ Some props are intentionally grouped under `options` instead of being top-level
433
433
434
434
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.
435
435
436
-
== Svelte 4| Svelte 5
436
+
== Svelte 4| Svelte 5
437
437
438
438
```svelte
439
439
<Form
@@ -629,7 +629,7 @@ To reset the form after a successful submission:
629
629
</Form>
630
630
```
631
631
632
-
== Svelte 4| Svelte 5
632
+
== Svelte 4| Svelte 5
633
633
634
634
```svelte
635
635
<!-- Reset the entire form on success -->
@@ -689,7 +689,7 @@ To reset the form after errors:
689
689
</Form>
690
690
```
691
691
692
-
== Svelte 4| Svelte 5
692
+
== Svelte 4| Svelte 5
693
693
694
694
```svelte
695
695
<!-- Reset the entire form on success -->
@@ -737,7 +737,7 @@ The `Form` component provides the `setDefaultsOnSuccess` attribute to set the cu
0 commit comments