freeCodeCamp/curriculum/challenges/portuguese/14-responsive-web-design-22/learn-html-forms-by-buildin.../60f81167d0d4910809f88945.md

1.9 KiB

id title challengeType dashedName
60f81167d0d4910809f88945 Passo 17 0 step-17

--description--

O primeiro elemento input com o type com valor de submit é definido automaticamente para que envie o elemento form pai mais próximo.

Para lidar com o envio do formulário, depois do último elemento fieldset, adicione um elemento input com o atributo type definido como submit e o atributo value definido como Submit.

--hints--

Você deve adicionar um elemento input após o último elemento fieldset.

assert.exists(document.querySelectorAll('fieldset')?.[2]?.nextElementSibling?.tagName, 'input');

Você deve dar ao elemento input um atributo type de submit.

assert.exists(document.querySelector('fieldset + input[type="submit"]'));

Você deve dar ao elemento input um atributo value de Submit.

assert.exists(document.querySelector('fieldset + input[value="Submit"]'));

--seed--

--seed-contents--

<!DOCTYPE html>
<html>
  <head>
    <title>Registration Form</title>
      <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <h1>Registration Form</h1>
    <p>Please fill out this form with the required information</p>
    <form action='https://register-demo.freecodecamp.org'>
--fcc-editable-region--
      <fieldset>
        <label>Enter Your First Name: <input type="text" /></label>
        <label>Enter Your Last Name: <input type="text" /></label>
        <label>Enter Your Email: <input type="email" /></label>
        <label>Create a New Password: <input type="password" /></label>
      </fieldset>
      <fieldset></fieldset>
      <fieldset></fieldset>

--fcc-editable-region--
    </form>
  </body>
</html>
body {
  width: 100%;
  height: 100vh;
  margin: 0;
  background-color: #1b1b32;
    color: #f5f6f7;
}

label {
    display: block;
    margin: 0.5rem 0;
}