X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML <form> action Attribute

HTML form Tag Reference HTML <form> tag

Example

On submit, send the form-data to a file named "demo_form.asp" (to process the input):

<form action="demo_form.asp" method="get">
  First name: <input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
  <input type="submit" value="Submit">
</form>

Try it Yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The action attribute is supported in all major browsers.


Definition and Usage

The action attribute specifies where to send the form-data when a form is submitted.


Differences Between HTML 4.01 and HTML5

In HTML5, the action attribute is no longer required.


Syntax

<form action="URL">

Attribute Values

Value Description
URL Where to send the form-data when the form is submitted.

Possible values:

  • An absolute URL - points to another web site (like action="http://www.example.com/example.htm")
  • A relative URL - points to a file within a web site (like action="example.htm")


HTML form Tag Reference HTML <form> tag

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook