Is this the complete code? If not ( as I guess since the opening <form> tag is missing) can you post it all? Are you asked to write some javascript too?
Thank you , I tested that and it works… /passed, but, would you mind explaining the mechanics of that for me… I don’t quite get what its purpose is etc. Like not all forms need a “name” field ? or is the Name field there as a key pair for the email field, and more “names” would be needed in a multi-input form etc >
The name attribute is used to reference elements in a JavaScript, or to reference form data after a form is submitted. Note: Only form elements with a name attribute will have their values passed when submitting a form.
Note: All input elements have a ‘name’ attribute. It is necessary to be able to access their values later.
In short, when you submit a form the default way of passing the data is through the FormData Api, which
creates a key-value pair using the name attribute of the field and the value of the field itself ^^
If the field has no name I guess it doesn’t build the key-value pair (I’m not sure if it doesn’t even check the value of a field without a name or if it can’t retrieve the value once inserted ^^ )