Skip to content

Commit 080f717

Browse files
authored
Update README.md to match solution (#494)
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
1 parent 5de34c7 commit 080f717

File tree

1 file changed

+18
-17
lines changed
  • content/tutorial/03-sveltekit/06-forms/03-form-validation

1 file changed

+18
-17
lines changed

Diff for: content/tutorial/03-sveltekit/06-forms/03-form-validation/README.md

+18-17
Original file line numberDiff line numberDiff line change
@@ -82,23 +82,24 @@ In `src/routes/+page.svelte`, we can access the returned value via the `form` pr
8282
+++export let form;+++
8383
</script>
8484

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>
102103
```
103104
104105
> 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

Comments
 (0)