Unexpected injected attributes: Learn HTML Forms by Building a Registration Form - code injected between step 40 and step 41

I noticed that between step 40 and step 41 of the registration form project, some name attributes are injected into the code.
For eg. in step 40: the following input elements do not have name attributes in the seed code:

      <fieldset>
        <label for="first-name">Enter Your First Name: <input id="first-name" type="text" required /></label>
        <label for="last-name">Enter Your Last Name: <input id="last-name" type="text" required /></label>
        <label for="email">Enter Your Email: <input id="email" type="email" required /></label>
        <label for="new-password">Create a New Password: <input id="new-password" type="password" pattern="[a-z0-5]{8,}" required /></label>
      </fieldset>

But in step 41, the seed code shows this (the name attributes are added):

        <fieldset>
        <label for="first-name">Enter Your First Name: <input id="first-name" name="first-name" type="text" required /></label>
        <label for="last-name">Enter Your Last Name: <input id="last-name" name="last-name" type="text" required /></label>
        <label for="email">Enter Your Email: <input id="email" name="email" type="email" required /></label>
        <label for="new-password">Create a New Password: <input id="new-password" name="new-password" type="password" pattern="[a-z0-5]{8,}" required /></label>
      </fieldset>

I checked the files in the repo to double check that my browser wasn’t doing something weird and I copied the code above directly from the files in the repo.
I’m pretty sure that step 41 used to be for adding names to submittable elements but now only the last fieldset needs them?

Does anyone see this as well? (is it a bug?)

Links to the challenges:
step-40

and
step-41

Radio buttons have names added here: https://www.freecodecamp.org/learn/2022/responsive-web-design/learn-html-forms-by-building-a-registration-form/step-28

1 Like

It definitely looks like an error in the seed text to me.

1 Like

I tried to check the history of the step but the last change was in December it seems and didn’t touch this code. (And in my mind I am thinking, was I dreaming that this step used to be different?)

My GitHub skills are not well developed so I wasn’t able to see all of that Randell. Were you able to find any reason for the change that added the name attributes?

okay, it doesn’t seem to be due to an intentional curriculum change so I will open an issue to restore the seed code to what it was (minus the name attributes in the top 2 fieldsets - not including the radio buttons)

thanks for the help! (let me know sometime how I can learn how to backtrack in the history like that! I went back 2 revisions and hit a list of changes that I didn’t understand and gave up!)

Locally, I used the following while in the freeCodeCamp repo

git log --color --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit curriculum/challenges/english/14-responsive-web-design-22/learn-html-forms-by-building-a-registration-form/60fad1cafcde010995e15306.md

where I got:

0168190281 - fix(curriculum): remove redundant name attribute (#48613) (8 weeks ago) <chowdharysn56>
be840dee58 - fix(curriculum): add lesson to registration form practice project for adding method attribute (#48208) (3 months ago) <Rohit Patel>
2e83a3d41d - fix(curriculum): add `for` attribute to `label` elements in registration-form project (#47332) (5 months ago) <Ilenia>
5cfa9caa61 - chore(curriculum): validate registration form project (#46855) (7 months ago) <Muhammed Mustafa>
3ecc381f95 - fix(curriculum): corrected grammar in line 12 of the description section of learn HTML forms.md (#46859) (7 months ago) <Harsh Kashyap>
e8be0c8a46 - chore: remove type attributes RWD (#46518) (8 months ago) <Sem Bauke>
965b46c406 - fix(curriculum): correct reg-form instruction (#45732) (10 months ago) <Shaun Hamilton>
6af38bb240 - fix(curriculum,i18n): issues in the source string (#45622) (10 months ago) <Farhan Hasin Chowdhury>
25aa04e2e7 - chore(curriculum): standardise titles for rwd-beta (#45398) (11 months ago) <Shaun Hamilton>
16e7cdedb1 - feat: migrate filenames to IDs (#45146) (11 months ago) <Naomi Carrigan>

Then, I started making diffs between each commit (starting at the first) until I could see where the code changed to add the name attributes.

When I got to:

git diff 5cfa9caa61..2e83a3d41d curriculum/challenges/english/14-responsive-web-design-22/learn-html-forms-by-building-a-registration-form/60fad1cafcde010995e15306.md

I saw the changes that occurred on the PR I referenced above.

FYI - Instead of typing out that long log command, I created an alias named lg like:

git config --global alias.lg "log --color --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

so I can just type the following instead:

git lg curriculum/challenges/english/14-responsive-web-design-22/learn-html-forms-by-building-a-registration-form/60fad1cafcde010995e15306.md
1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.