<form method="" action="">

Browser
  • IE
  • Cr
  • Sf
  • Fx
  • O
Type

The action attribute of the FORM element defines where to send the form data, and the method attribute specifies the HTTP method for sending the form data.


<form method="POST" action="example.cgi"></form>

Attribute Value Explanation
method=" " POST sent with the POST method
GET sent with the GET method (default)
action=" " URL the form data is sent to this URL

HTTP method

POST
The POST method sends the form data in the body of the HTTP request.
(A large amount of data can be sent.)
GET
The GET method sends the form data within the URL.
http://www.example.com/example.cgi?name1=value1&name2=value2
(There are limits to the number of characters that can be sent.)

Example


<form method="POST" action="example.cgi">

<p>Name<br>
<input type="text" name="Name" size="30"></p>

<p>Comments<br>
<textarea cols="30" rows="5" name="Comment"></textarea></p>

<p><input type="submit" value="Submit"></p>

</form>

Output

Name

Comments

This form cannot submit because of a sample.