HTML Tutorial
HTML Basics
HTML Forms
HTML Graphics
HTML Media
HTML API
HTML Input Form * Attributes
The form Attribute
The input form attribute defines the form the <input> element belongs to.
The value of this attribute should be equal to the id attribute of the <form> element it belongs to.
Example
The formaction Attribute
The input formaction attribute defines the URL of the file that processes the input while submitting the form.
The formaction attribute is used with the following input types: submit and image.
Example
The formmethod Attribute
The input formmethod attribute specifies the HTTP method for sending form-data to the action URL.
The formmethod attribute is used with the following input types: submit and image.
The form-data is sent as URL variables (method=”get”) or as an HTTP post transaction (method=”post”).
Notes on the “get” method:
- This method is used to append the form-data to the URL in name/value pairs.
- This method is used for form submissions where a user bookmarks the result.
- The “get” method should not be used to pass sensitive information.
Notes on the “post” method:
- This method is used for sending the form-data as an HTTP post transaction.
- Form submissions with the “post” method cannot be bookmarked.
- The “post” method is secure as compared to “get”, and “post.” does not have size limitations.
The formtarget Attribute
The input formtarget attribute defines a name or a keyword, which points where to display the response that is received after submitting the form.
The formtarget attribute is used with the following input types: submit and image.
Example
The formnovalidate Attribute
The input formnovalidate attribute defines an <input> element that cannot be validated while submitting the form.
The formnovalidate attribute is used with the following input types: submit.
Example
The novalidate Attribute
The novalidate attribute is a <form> attribute and defines all of the form-data should not be validated when submitted.
Example