London | January 2026 | Ihor Taradaiko | Sprint 2 | Form Controls#1040
London | January 2026 | Ihor Taradaiko | Sprint 2 | Form Controls#1040ihortar wants to merge 7 commits intoCodeYourFuture:mainfrom
Conversation
✅ Deploy Preview for cyf-onboarding-module ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
cjyuan
left a comment
There was a problem hiding this comment.
-
According to https://validator.w3.org/, there are errors in your code. Can you fix them?
-
Have you tested the form? That is, try to submit the form with different input, including both valid and invalid input.
Form-Controls/index.html
Outdated
| </form> | ||
| </main> | ||
| <footer> |
There was a problem hiding this comment.
Can you improve the indentation?
VSCode's "Format Document" feature can help us format our code for better readability and consistency.
To use the feature, right-click inside the code editor and select the option.
Please note that if there are syntax errors in the code, the "Prettier" extension may not format HTML code properly.
Form-Controls/index.html
Outdated
| /> | ||
| </p> | ||
| <p> | ||
| <label for="r2">What's your email address?*</label> |
There was a problem hiding this comment.
Can you use AI to find out why it is not a good practice to use names like r2, r3, c1foridandclass` in HTML, and update them accordingly?
Form-Controls/index.html
Outdated
| required | ||
| minlength="3" | ||
| maxlength="30" | ||
| pattern="[A-Za-z ]+" |
There was a problem hiding this comment.
Currently a user can enter a name consisting of only space characters (e.g., " "). Can you enforce a stricter pattern to reject any name containing only space characters?
Form-Controls/index.html
Outdated
| <input type="text" | ||
| name="color" | ||
| placeholder="Color" | ||
| required | ||
| list="c1" | ||
| /> | ||
| <datalist id="c1"> | ||
| <option>Yellow</option> | ||
| <option>Blue</option> | ||
| <option>White</option> | ||
| </datalist> | ||
| </p> |
There was a problem hiding this comment.
Currently a user can enter a value that is not in the list. For example, "ABCDEF".
|
Hi @cjyuan |
cjyuan
left a comment
There was a problem hiding this comment.
The code in index.html is incomplete -- it would not pass the validation on https://validator.w3.org/.
Form-Controls/index.html
Outdated
| <input type="text" id="color" name="color" placeholder="Color" list="color-options" pattern="Yellow|Blue|White" | ||
| required /> | ||
| <datalist id="color-options"> | ||
| <option>Yellow</option> | ||
| <option>Blue</option> | ||
| <option>White</option> | ||
| </datalist> |
There was a problem hiding this comment.
Why not use <select> element to create the drop-down list?
With your current implementation, the input field seems to invite a different value but it does not. When a value not on the list is entered, it only gives the message "Please match the requested format", which does not explain what "format" is expected.
There was a problem hiding this comment.
@cjyuan to be honest, I thought it's nice to be able to not just select the color from the list but also to select it by typing the text.
Since in the task, the only requirement was to select only one color/size I thought it worked fine.
Fixed the code and validated that it does not show any errors.
There was a problem hiding this comment.
I am mentioning this to raise a design issue, and it is just a suggestion.
On one hand, if we let the user type the input freely, they could enter some weird value.
On the other hand, if we restrict (using pattern) the possible input to just three possible values, why not just let them choose one of the three colors?
There was a problem hiding this comment.
In the task the user had to be able to choose one of three colors, imho, datalist worked just fine.
I do understand what you meant, but it just fits the requirements.
With the form is definitely more straightforward.
There was a problem hiding this comment.
I forgot the mention the accessibility issue between using "select" and using "input+datalist". People who needs a screen reader to access a webpage can "see" them differently. For former indicates, "choose one of N options", the latter may indicate "enter text here freely".
|
Changes look good. Well done. |

Changelist