Set the Name of the Form
Description
The name
attribute sets a unique identifier for a form.
Example
The following code shows a form element with the name
and id
attributes.
They have the same value.
<!DOCTYPE HTML>
<html>
<body>
<form name="fruitvote"
id="fruitvote"
method="post"
action="http://example.com/form">
<input name="fave" />
<input name="name" />
<button>Submit Vote</button>
</form>
</body>
</html>
Note
The value of the name attribute is not sent to the server when the form is posted. This attribute is only useful in the DOM operation in the client side and is not as important as the name attribute on the input element.
If an input element doesn't have a name attribute, the data that the user has entered will not be sent to the server when the form is submitted.