Skip to content

London | January 2026 | Ihor Taradaiko | Sprint 2 | Form Controls#1040

Open
ihortar wants to merge 7 commits intoCodeYourFuture:mainfrom
ihortar:forms-controls
Open

London | January 2026 | Ihor Taradaiko | Sprint 2 | Form Controls#1040
ihortar wants to merge 7 commits intoCodeYourFuture:mainfrom
ihortar:forms-controls

Conversation

@ihortar
Copy link

@ihortar ihortar commented Jan 24, 2026

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

  • My form is semantic html.
  • All inputs have associated labels.
  • My Lighthouse Accessibility score is 100.
  • I require a valid name. I have defined a valid name as a text string of two characters or more.
  • I require a valid email.
  • I require one colour from a defined set of 3 colours.
  • I require one size from a defined set of 6 sizes.

@netlify
Copy link

netlify bot commented Jan 24, 2026

Deploy Preview for cyf-onboarding-module ready!

Name Link
🔨 Latest commit 2ce19c9
🔍 Latest deploy log https://app.netlify.com/projects/cyf-onboarding-module/deploys/6984e851ad4338000838c48c
😎 Deploy Preview https://deploy-preview-1040--cyf-onboarding-module.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
2 paths audited
Performance: 100 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 86 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@ihortar ihortar added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jan 24, 2026
@ihortar ihortar marked this pull request as ready for review January 24, 2026 14:43
@cjyuan cjyuan added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Feb 2, 2026
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 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.

Comment on lines 72 to 74
</form>
</main>
<footer>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

/>
</p>
<p>
<label for="r2">What's your email address?*</label>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

required
minlength="3"
maxlength="30"
pattern="[A-Za-z ]+"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment on lines 39 to 50
<input type="text"
name="color"
placeholder="Color"
required
list="c1"
/>
<datalist id="c1">
<option>Yellow</option>
<option>Blue</option>
<option>White</option>
</datalist>
</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently a user can enter a value that is not in the list. For example, "ABCDEF".

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Feb 2, 2026
@ihortar
Copy link
Author

ihortar commented Feb 5, 2026

Hi @cjyuan
Thank you for checking my PR!
I appreciate all the hints (I was looking for a button like "beautify" in Postman, but could not find it)
I have fixed the code and tested the form, it works as expected now.
Please check when available.
Thank you.

@ihortar ihortar added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 5, 2026
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code in index.html is incomplete -- it would not pass the validation on https://validator.w3.org/.

Comment on lines 17 to 23
<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>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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".

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 5, 2026
@ihortar ihortar added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 5, 2026
@cjyuan
Copy link
Contributor

cjyuan commented Feb 5, 2026

Changes look good. Well done.

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants