freeCodeCamp/curriculum/challenges/italian/14-responsive-web-design-22/learn-html-forms-by-buildin.../63541ef4f96cd82e8e6c788a.md

1.4 KiB

id title challengeType dashedName
63541ef4f96cd82e8e6c788a Step 12 0 step-12

--description--

L'attributo method specifica come inviare il modulo dati all'URL specificato nell'attributo action. Il modulo dati può essere inviato tramite richiesta GET come parametri URL (con method="get") o tramite una richiesta POST come dati nel corpo della richiesta (con method="post").

Imposta l'attributo method per inviare il modulo dati tramite richiesta POST.

--hints--

Dovresti aggiungere un nuovo elemento form.

assert.equal(document.querySelectorAll('form').length, 1 )

L'elemento form dovrebbe avere un attributo method.

assert.exists(document.querySelector('form')?.getAttribute('method'));

L'attributo method dovrebbe essere impostato su post.

assert.equal(document.querySelector('form')?.getAttribute('method'), 'post');

--seed--

--seed-contents--

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <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>
    --fcc-editable-region--
    <form action='https://register-demo.freecodecamp.org'></form>
--fcc-editable-region--
  </body>
</html>
body {
  width: 100%;
  height: 100vh;
  margin: 0;
  background-color: #1b1b32;
  color: #f5f6f7;
}