[Forms 06 - Multiple Inputs] Why do we need a "name" property?

Just wondering, and this may become apparent in later lectures, but when referring to specific form inputs Mosh creates a brand new property called Name which is named the same as ID.

Is there a reason he doesn’t just use the existing ID property?

Form data is submitted as a set of name value pairs. So for example when this form is submitted…

<form action="http://localhost:3000" method="POST">
  <input id="some-id" name="some-name" type="text">
  <input type="submit" value="Click to Submit">


The following form data is submitted to the server…


The name attribute is used as the name of the name value pair. And without a name attribute, the data isn’t submitted at all.