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

65 lines
1.4 KiB
Markdown
Raw Normal View History

---
id: 63541ef4f96cd82e8e6c788a
title: Step 12
challengeType: 0
dashedName: 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`.
```js
assert.equal(document.querySelectorAll('form').length, 1 )
```
L'elemento `form` dovrebbe avere un attributo `method`.
```js
assert.exists(document.querySelector('form')?.getAttribute('method'));
```
L'attributo `method` dovrebbe essere impostato su `post`.
```js
assert.equal(document.querySelector('form')?.getAttribute('method'), 'post');
```
# --seed--
## --seed-contents--
```html
<!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>
```
```css
body {
width: 100%;
height: 100vh;
margin: 0;
background-color: #1b1b32;
color: #f5f6f7;
}
```