method Attribute


 

Where to use the method Attribute

  • As Type Enumeration (get | post) - default="get":
    method is declared on the element: form

Description

The method attribute is specified on the form element and tells the user agent which HTTP method to use to submit the form data.

The default method is "get" which sends the form data appended as a query string to the URI specified in the action attribute. This method is good for short, simple forms which do not cause any side-effects, such as a database modification.

The alternative method, "post", involves the user agent first making contact with the processing server (specified in the action attribute) and, once contact has been established, sending all the form data to the server in a separate transmission. The "post" method should be used for any request which causes side-effects, (such as updating a database, sending an e-mail, etc.) and also for large form data sets (e.g. those containing textarea elements, many fields, or files for upload - in this last case the enctype should be set to "multipart/form-data" as well).


Page Footer & Copyright

Copyright © Sally Maughan 2005-2009 (Page last updated on 16 May 2009)

*Valid XHTML 1.1 - hosted by *Openstrike

Content based on the W3C Working Draft: *XHTML 1.1 and Recommendation: *XHTML Modularisation 1.1.

W3C, XHTML, XML, HTML, CSS and MathML are *Trademarks of the W3C (*MIT, *ERCIM, *Keio) with which the site's author has no connection.


Up, Next & Previous Links

Your Location

Home > XHTML 1.1 Home > XHTML 1.1 Indexes > Attribute Index (XHTML 1.1) > method Attribute (XHTML 1.1)