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
The readme is missing the line:
<div class="centered">
as well as the indentation that are present in the code editor solution.
this can cause a slight confusion while following the tutorial
Copy file name to clipboardExpand all lines: content/tutorial/03-sveltekit/06-forms/03-form-validation/README.md
+18-17
Original file line number
Diff line number
Diff line change
@@ -82,23 +82,24 @@ In `src/routes/+page.svelte`, we can access the returned value via the `form` pr
82
82
+++exportlet form;+++
83
83
</script>
84
84
85
-
<h1>todos</h1>
86
-
87
-
+++{#if form?.error}
88
-
<p class="error">{form.error}</p>
89
-
{/if}+++
90
-
91
-
<form method="POST" action="?/create">
92
-
<label>
93
-
add a todo:
94
-
<input
95
-
name="description"
96
-
+++value={form?.description??''}+++
97
-
autocomplete="off"
98
-
required
99
-
/>
100
-
</label>
101
-
</form>
85
+
<div class="centered">
86
+
<h1>todos</h1>
87
+
88
+
+++{#if form?.error}
89
+
<p class="error">{form.error}</p>
90
+
{/if}+++
91
+
92
+
<form method="POST" action="?/create">
93
+
<label>
94
+
add a todo:
95
+
<input
96
+
name="description"
97
+
+++value={form?.description??''}+++
98
+
autocomplete="off"
99
+
required
100
+
/>
101
+
</label>
102
+
</form>
102
103
```
103
104
104
105
> You can also return data from an action _without_ wrapping it in `fail` — for example to show a 'success!' message when data was saved — and it will be available via the `form` prop.
0 commit comments