Skip to content

Commit 6999255

Browse files
committed
fix: Correct Docs on FormValidityObserver Integrations
We accidentally used `aria-labelledby` where `aria-describedby` should have been used. That is VERY confusing (and incorrect).
1 parent cde08f1 commit 6999255

File tree

1 file changed

+6
-6
lines changed
  • docs/form-validity-observer/integrations

1 file changed

+6
-6
lines changed

docs/form-validity-observer/integrations/README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ When you're working with pure HTML and pure JS, you'll have code that looks like
1818
```html
1919
<form>
2020
<label for="username">Username</label>
21-
<input id="username" name="username" type="text" required aria-labelledby="username-error" />
21+
<input id="username" name="username" type="text" required aria-describedby="username-error" />
2222
<div id="username-error" role="alert"></div>
2323

2424
<label for="email">Email</label>
25-
<input id="email" name="email" type="email" required aria-labelledby="email-error" />
25+
<input id="email" name="email" type="email" required aria-describedby="email-error" />
2626
<div id="email-error" role="alert"></div>
2727

2828
<!-- Other Fields -->
@@ -46,11 +46,11 @@ The code above is pretty simple. However, the fact that we have to keep track of
4646
```svelte
4747
<form bind:this={form}>
4848
<label for="username">Username</label>
49-
<input id="username" name="username" type="text" required aria-labelledby="username-error" />
49+
<input id="username" name="username" type="text" required aria-describedby="username-error" />
5050
<div id="username-error" role="alert" />
5151
5252
<label for="email">Email</label>
53-
<input id="email" name="email" type="email" required aria-labelledby="email-error" />
53+
<input id="email" name="email" type="email" required aria-describedby="email-error" />
5454
<div id="email-error" role="alert" />
5555
5656
<!-- Other Fields -->
@@ -80,14 +80,14 @@ This can be simplified if we augment the `configure` function to generate the co
8080
```svelte
8181
<form use:autoObserve>
8282
<label for="username">Username</label>
83-
<input id="username" {...configure("username", { required })} aria-labelledby="username-error" />
83+
<input id="username" {...configure("username", { required })} aria-describedby="username-error" />
8484
<div id="username-error" role="alert" />
8585
8686
<label for="email">Email</label>
8787
<input
8888
id="email"
8989
{...configure("email", { required, type: { value: "email", message: "Please provide a valid email" } })}
90-
aria-labelledby="email-error"
90+
aria-describedby="email-error"
9191
/>
9292
<div id="email-error" role="alert" />
9393

0 commit comments

Comments
 (0)