-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve a11y in form example #1917
base: main
Are you sure you want to change the base?
Changes from 12 commits
ffea9af
39562f9
c52754c
e0084f7
754860b
be325a6
4f61888
36fd5a9
577a726
92eaed6
1f025f6
27befc7
b1f35e5
fcc5cb2
bb490e3
3c76a78
6d2aed1
79a338b
4543bc8
728cde9
40037e2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,7 +94,7 @@ <h1 class="display-1">Become a reseller</h1> | |
</div> | ||
<div class="col-sm-4 col-md-6 mb-3"> | ||
<label for="selectTitle" id="selectTitleLabel" class="form-label is-required">Title</label> | ||
<select class="form-select" id="selectTitle" aria-labelledby="selectTitleLabel selectTitleFeedback" autocomplete="sex" required> | ||
<select class="form-select" id="selectTitle" aria-labelledby="selectTitleLabel" autocomplete="sex" required> | ||
<option selected disabled value="" aria-hidden="true">Select a title</option> | ||
<option value="1">Miss</option> | ||
<option value="2">Mr.</option> | ||
|
@@ -105,44 +105,44 @@ <h1 class="display-1">Become a reseller</h1> | |
<div class="valid-feedback"> | ||
Looks good! | ||
</div> | ||
<div id="selectTitleFeedback" class="invalid-feedback"> | ||
<div id="selectTitleFeedback" class="invalid-feedback" role="alert"> | ||
Please select a valid title. | ||
</div> | ||
</div> | ||
<div class="col-12"> | ||
<div class="mb-3"> | ||
<label for="firstName" id="firstNameLabel" class="form-label is-required">First name</label> | ||
<input type="text" class="form-control" id="firstName" aria-labelledby="firstNameLabel firstNameFeedback" autocomplete="given-name" required> | ||
<input type="text" class="form-control" id="firstName" aria-labelledby="firstNameLabel" autocomplete="given-name" required> | ||
<div class="valid-feedback"> | ||
Looks good! | ||
</div> | ||
<div id="firstNameFeedback" class="invalid-feedback"> | ||
<div id="firstNameFeedback" class="invalid-feedback" role="alert"> | ||
Please enter a valid first name. | ||
</div> | ||
</div> | ||
<div class="mb-3"> | ||
<label for="lastName" id="lastNameLabel" class="form-label is-required">Last name</label> | ||
<input type="text" class="form-control" id="lastName" aria-labelledby="lastNameLabel lastNameFeedback" autocomplete="family-name" required> | ||
<input type="text" class="form-control" id="lastName" aria-labelledby="lastNameLabel" autocomplete="family-name" required> | ||
<div class="valid-feedback"> | ||
Looks good! | ||
</div> | ||
<div id="lastNameFeedback" class="invalid-feedback"> | ||
<div id="lastNameFeedback" class="invalid-feedback" role="alert"> | ||
Please enter a valid last name. | ||
</div> | ||
</div> | ||
<div class="mb-3"> | ||
<label for="email" id="emailLabel" class="form-label is-required">Email</label> | ||
<input type="email" class="form-control" id="email" aria-labelledby="emailLabel emailFeedback" autocomplete="email" required> | ||
<input type="email" class="form-control" id="email" aria-labelledby="emailLabel" autocomplete="email" required> | ||
<div class="valid-feedback"> | ||
Looks good! | ||
</div> | ||
<div id="emailFeedback" class="invalid-feedback"> | ||
<div id="emailFeedback" class="invalid-feedback" role="alert"> | ||
Please provide a valid email. | ||
</div> | ||
</div> | ||
<div class="mb-3"> | ||
<label for="country" id="countryLabel" class="form-label is-required">Country</label> | ||
<select class="form-select" id="country" aria-labelledby="countryLabel countryFeedback" autocomplete="country-name" required> | ||
<select class="form-select" id="country" aria-labelledby="countryLabel" autocomplete="country-name" required> | ||
<option selected disabled value="" aria-hidden="true">Select a country</option> | ||
<option value="1">Australia</option> | ||
<option value="2">Canada</option> | ||
|
@@ -152,23 +152,23 @@ <h1 class="display-1">Become a reseller</h1> | |
<div class="valid-feedback"> | ||
Looks good! | ||
</div> | ||
<div id="countryFeedback" class="invalid-feedback"> | ||
<div id="countryFeedback" class="invalid-feedback" role="alert"> | ||
Please select a valid country. | ||
</div> | ||
</div> | ||
<div class="mb-3"> | ||
<label for="company" id="companyLabel" class="form-label is-required">Name of company</label> | ||
<input type="text" class="form-control" id="company" aria-labelledby="companyLabel companyFeedback" required> | ||
<input type="text" class="form-control" id="company" aria-labelledby="companyLabel" required> | ||
<div class="valid-feedback"> | ||
Looks good! | ||
</div> | ||
<div id="companyFeedback" class="invalid-feedback"> | ||
<div id="companyFeedback" class="invalid-feedback" role="alert"> | ||
Please enter a valid company name. | ||
</div> | ||
</div> | ||
<div class="mb-3"> | ||
<label for="business" id="businessLabel" class="form-label is-required">Business type</label> | ||
<select class="form-select" id="business" aria-labelledby="businessLabel businessFeedback" required> | ||
<select class="form-select" id="business" aria-labelledby="businessLabel" required> | ||
<option selected disabled value="" aria-hidden="true">Select a type</option> | ||
<option value="1">Corporation</option> | ||
<option value="2">Limited liability company</option> | ||
|
@@ -178,17 +178,17 @@ <h1 class="display-1">Become a reseller</h1> | |
<div class="valid-feedback"> | ||
Looks good! | ||
</div> | ||
<div id="businessFeedback" class="invalid-feedback"> | ||
<div id="businessFeedback" class="invalid-feedback" role="alert"> | ||
Please select a valid business type. | ||
</div> | ||
</div> | ||
<div class="mb-3"> | ||
<label for="website" id="websiteLabel" class="form-label">Website</label> | ||
<input type="text" class="form-control" id="website" aria-labelledby="websiteLabel websiteFeedback"> | ||
<input type="text" class="form-control" id="website" aria-labelledby="websiteLabel"> | ||
<div class="valid-feedback"> | ||
Looks good! | ||
</div> | ||
<div id="websiteFeedback" class="invalid-feedback"> | ||
<div id="websiteFeedback" class="invalid-feedback" role="alert"> | ||
Please enter a valid website. | ||
</div> | ||
</div> | ||
|
@@ -197,11 +197,11 @@ <h1 class="display-1">Become a reseller</h1> | |
<button type="button" class="form-helper" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="Help for text area"> | ||
<span class="visually-hidden">Helper for text area</span> | ||
</button> | ||
<textarea class="form-control" id="message" rows="5" placeholder="Describe your business and your motivation in becoming an Orange reseller" aria-labelledby="messageLabel messageFeedback" required></textarea> | ||
<textarea class="form-control" id="message" rows="5" placeholder="Describe your business and your motivation in becoming an Orange reseller" aria-labelledby="messageLabel" required></textarea> | ||
<div class="valid-feedback"> | ||
Looks good! | ||
</div> | ||
<div id="messageFeedback" class="invalid-feedback"> | ||
<div id="messageFeedback" class="invalid-feedback" role="alert"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should add the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's one of the point Vincent and I want to bring to the next specs meeting. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah yes you're right, Bs first for documentation! |
||
Please enter a valid message. | ||
</div> | ||
</div> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My point above but just recalling it here, We should have a way to display several feedbacks if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happen when a field has multiple invalid feeddbacks will be discussed in the next specs meeting.