Skip to content

add solution - #1949

Open
lubovmrk wants to merge 2 commits into
mate-academy:masterfrom
lubovmrk:develop
Open

lubovmrk wants to merge 2 commits into
mate-academy:masterfrom
lubovmrk:develop

Conversation

@lubovmrk

@lubovmrk lubovmrk commented Sep 9, 2026

Copy link
Copy Markdown
- [DEMO LINK](https://lubovmrk.github.io/js_task_fix_form_DOM/)

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

I’m requesting changes because there’s a critical mismatch with the expected result: on src/scripts/main.js line 15 you set label.textContent = input.name, which leaves the label text uncapitalized. The task requires the label text to match the capitalized format (like the placeholder), and you already compute this as formattedName on line 6.

  • What to fix (critical): Replace the assignment on line 15 to use formattedName instead of input.name so the label text is capitalized and matches the preview.
  • Why this matters: It’s part of the core visual requirement and checklist; leaving it uncapitalized causes a visible discrepancy from the expected result.

Everything else (label creation, class, for attribute, insertion, and placeholders) looks correct. After making this small change, your solution should fully meet the requirements. Keep up the good work!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread src/scripts/main.js Outdated

label.classList.add('field-label');
label.htmlFor = input.id;
label.textContent = input.name;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

According to the task requirements and expected result preview, the label text should be capitalized (like the placeholder). Change input.name to formattedName here to use the capitalized version that was already created on line 6.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

Your implementation fully satisfies all task requirements. The code correctly capitalizes input names for both placeholders and labels, creates label elements with the required field-label class and for attribute pointing to each input's id, and properly appends labels to parent containers without wrapping. All checklist items are satisfied, including the previously flagged issue with uncapitalized label text now being resolved using the formattedName variable. The solution is clean, functional, and ready for use.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants