Forms are the HTML mechanism for gathering input from the user.
To create a basic form, you need three elements:
The following table shows an HTML document that contains a simple form.
<!DOCTYPE HTML> <html> <body> <form method="post" action="http://example.com/form"> <input name="name" /> <button>Submit Vote</button> </form> </body> </html>
The form element,
with local attributes:
action, method, enctype, name,
accept-charset, novalidate,target, autocomplete,
,creates a form in an HTML page.
autocomplete attributes are new in HTML5.
method attribute specifies which HTTP method will
be used to send the form data to the server.
The allowed values are
which correspond to the HTTP GET and POST methods.
The default value for method attribute is
The following code set the
post value for the form.
<form method="post" action="http://example.com/form">
you can make the same request many times.
GET requests should be used for all read-only information retrieval.
POST requests are for unsafe interactions,
where the act of submitting the data changes some kind of state.
POST requests should be used for any operation that changes the application state.