Learn HTML Forms by Building a Registration Form - Step 13

Tell us what’s happening:
Describe your issue in detail here.

Step 13

As the form will have three distinct sections, add three fieldset elements within the form element.

I’ve added 3x ‘fieldset’ elements within the ‘form’ element, but am still getting an error. I’ve tried both my current code, and by creating additional ‘form’ elements to contain each ‘fieldset’ element as well, but both return error.
Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Registration Form</title>
    <link rel="stylesheet" href="styles.css" />
  </head>

<!-- User Editable Region -->

  <body>
    <h1>Registration Form</h1>
    <p>Please fill out this form with the required information</p>
    <form method="post" action='https://register-demo.freecodecamp.org'>
      <fieldset>
      <fieldset/>
      <fieldset>
      <fieldset/>
      <fieldset>
      <fieldset/>
    </form>
  </body>

<!-- User Editable Region -->

</html>
/* file: styles.css */
body {
  width: 100%;
  height: 100vh;
  margin: 0;
  background-color: #1b1b32;
  color: #f5f6f7;
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36

Challenge: Learn HTML Forms by Building a Registration Form - Step 13

Link to the challenge:

Ok, I just reset the lesson and tried keeping the ‘fieldset’ elements inline, and that worked. I would have assumed that it would have/should have worked on separate lines, but not sure.

This is the code that worked:

  <body>
    <h1>Registration Form</h1>
    <p>Please fill out this form with the required information</p>
    <form method="post" action='https://register-demo.freecodecamp.org'>
    <fieldset></fieldset><fieldset></fieldset><fieldset></fieldset>
    </form>
  </body>

That’s great!! you can also make sure that the opening tag and the closing tags are inline when empty i.e.

etc......

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