form method Attribute - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:form

Description

The method attribute specifies how to send form-data.

The form-data can be sent as URL variables (with method="get") or as HTTP post transaction (with method="post").

Attribute Values

Value Description
get Default. Appends the form-data to the URL in name/value pairs: URL?name=value&name=value
post Sends the form-data as an HTTP post transaction

The following code shows how to Submit a form using the "get" method:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<form action="/action_page.php" method="get" target="_blank">
  First name: <input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
  <input type="submit" value="Submit">
</form><!--from  ww  w.j a v  a 2 s  . c o  m-->

</body>
</html>

Related Tutorials