Skip to content

add solution - #1976

Open
olena0112 wants to merge 3 commits into
mate-academy:masterfrom
olena0112:develop
Open

olena0112 wants to merge 3 commits into
mate-academy:masterfrom
olena0112:develop

Conversation

@olena0112

Copy link
Copy Markdown

@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 code has a critical requirement violation. The task explicitly requires getting inputs from the form tag, but you're using document.querySelectorAll('input') which selects ALL inputs on the page. This doesn't meet the requirement "Get all inputs from form tag on the page."

To fix this, scope your selector to the form element. You can use either:

  • document.querySelector('form').querySelectorAll('input')
    or
  • document.querySelector('form').elements

This ensures you're only targeting inputs within the form, as required by the task description.


✨ 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
'use strict';

// write code here
const inputs = document.querySelectorAll('input');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The requirement specifies to get inputs from the 'form' tag, but this selects ALL inputs on the page. Should use document.querySelector('form').querySelectorAll('input') or document.querySelectorAll('form input') instead.

@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 code is passing 8 tests for the sign-up form, but there are 4 failing tests for the sign-in form that need to be fixed. The sign-in form inputs (#sign-in-email and #sign-in-password) are missing both placeholder attributes and associated <label> elements. You need to add placeholders and labels to the sign-in form following the same pattern you used for the sign-up form. Specifically: add placeholder attributes to the sign-in inputs (capitalized from the input's name), and create <label> elements with for attributes matching the input IDs and class="field-label". The tests expect labels and placeholders on both forms, not just one.


✨ 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 ↩

@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 solution is approved! The code correctly implements all the required functionality - it iterates over all forms on the page, creates labels with the proper field-label class, sets the for attribute to match input IDs, and generates placeholders from the input names. Great job handling both sign-up and sign-in forms by using document.querySelectorAll('form'). As a learning note, keep in mind that this solution depends on having proper name attributes on all form inputs - if an input lacks a name attribute, accessing input.name[0] would cause an error. This is a good example of why defensive coding with checks like input.name before accessing its properties can be helpful. Well done on meeting all the checklist requirements!


✨ 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