HTML form method Attribute

Definition and Usage

The method attribute specifies method to use to send the form data to the specified URL.
The form data is sent to the page specified in the action attribute.


<form method="send_method">

Syntax Example

<a type="text/html">

Attribute Values

Value Description
get Default. This method sends the form contents in the URL: URL?name=value&name=value. Note: If the form values contains non-ASCII characters or exceeds 100 characters you MUST use method="post".
post This method sends the form contents in the body of the request.Note: Browsers are unable to bookmark post requests.

Browser Support

The attribute is supported in all major browsers.

Tips and Notes

Note: When using the get method, form names and values are displayed in the URL. So this method should not be used when sending passwords or other sensitive information!


<form action="demo_form_method.asp" method="get">
First name: 
<input type="text" name="FirstName" 
value="Harry" />
<br />
Last name: 
<input type="text" name="LastName" 
value="Potter" />
<br />
<input type="submit" value="Submit" />

HTML form method Attribute Reviewed by 1000sourcecodes on 03:50 Rating: 5
Powered by Blogger.