Action normally specifies the file/page that the form is submitted to (using the method described in the method paramater (post, get etc.))

An action of # indicates that the form stays on the same page, simply suffixing the url with a #. Similar use occurs in anchors. <a href=#">Link</a> for example, will stay on the same page.

Thus, the form is submitted to the same page, which then processes the data etc.

Answer from MEURSAULT on Stack Overflow
🌐
W3Schools
w3schools.com › tags › att_form_action.asp
HTML form action Attribute
The action attribute specifies where to send the form-data when a form is submitted.
🌐
Reddit
reddit.com › r/html › what is mean? i find it confusing. my question involves python flask but you don't need to understand very much of python or flask.
r/HTML on Reddit: What is <form action => mean? I find it confusing. My question involves python flask but you don't need to understand very much of python or flask.
September 24, 2021 -

new_post.html

<form action="/post/new" method="Post">
to the website_names/post.new route.

If I am not mistaken the action form accepts the data from the website_name/post/new in the example above.

new_post.html

<form action " " method="Post">

What do the double empty quotes mean? Does it just fill in the form depending on the route?

My next question is imagine I have 2 routes in python flask that sends data to new_post.html.

The 2 routes in python flask are "post/new" and "/post/edit/<int:post_id>".

If I include the first example of new_post.hmtl could this lead to 500 error if I use the "/post/edit/<int:post_id>" ?

Should I ask this in the flask sub reddit or is here okay?

🌐
Career Karma
careerkarma.com › blog › html › html form action attribute: a how-to guide
HTML Form action Attribute: A How-To Guide | Career Karma
December 29, 2020 - Above, the action is sending the username and email data to a page named process.html. The username and email data has the input type “text”. We define a button with the input type “submit”. When clicked, this button will send our data to our “action” URL. Now plug in the form example above in an actual HTML file.
🌐
W3Schools
w3schools.com › Tags › att_formaction.asp
HTML formaction Attribute
A form with two submit buttons. The first submit button submits the form data to "action_page.php", and the second submits to "action_page2.php":
🌐
GeeksforGeeks
geeksforgeeks.org › html › html-action-attribute
HTML action Attribute - GeeksforGeeks
July 11, 2025 - The HTML action attribute is used to specify where the form data should be sent on submission.
🌐
HTML.com
html.com › attributes › form-action
Attribute for ACTION = "URL"
July 3, 2017 - Specifies a URL to which the form's data is sent when submitted.
🌐
Merriam-Webster
merriam-webster.com › legal › form of action
FORM OF ACTION Definition & Meaning | Merriam-Webster Legal
The meaning of FORM OF ACTION is any of the personal actions (as assumpsit, detinue, or replevin) formerly brought at common law.
Find elsewhere
🌐
Javatpoint
javatpoint.com › html-form-action
HTML Form Action - Javatpoint
September 16, 2022 - HTML Form Action - HTML Form Action with html tutorial, tags, anchor, img, div, entity, textarea, marquee, p tag, heading tag, h1, h2, table, formatting, attribute, elements, ol, ul, Input Types, block element tag, inline element tag, html tags, phrase tag, head, body, form, lists, symbols etc.
🌐
TutorialsPoint
tutorialspoint.com › html-form-action-attribute
HTML Form action Attribute
November 28, 2024 - The HTML form action attribute defines where to send the form data when a form is submitted in an HTML document. Syntax Following is the syntax − <form action=”URL”></form
🌐
HTML Form Guide
html.form.guide › action
Form Action | HTML Form Guide
A form action button is a button element that is used to submit a form to a server. It triggers the form submission when clicked, and sends the form data to the server for processing.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › API › HTMLFormElement › action
HTMLFormElement: action property - Web APIs | MDN
April 7, 2023 - The action of a form is the program that is executed on the server when the form is submitted.
🌐
Wufoo
wufoo.com › home › html5 web resource and guide › html5 forms: formaction type attribute
HTML5 Forms: FormAction Type Attribute | Wufoo
July 30, 2019 - The formaction attribute forces a form to direct to the specified URL instead of the URL specified as the value of the action attribute in the <form> element.
🌐
Scaler
scaler.com › topics › form-action-in-html
Form Action in HTML - Scaler Topics
May 18, 2022 - Forms are used to accept the data from the user, and a form is useless unless some kind of processing takes place after submitting the form. To do this processing, there is an attribute called the action attribute, which specifies where to send the form data when submitted.
🌐
Quora
quora.com › What-does-form-action-some_url-method-POST-really-mean
What does <form action="some_url" method = POST> really mean?
1. What is the meaning of "action = 'some url' "- It means that you are providing an address or a URL of a page where all your back end code is written. All the form data will be forwarded there as the submit button is clicked and this data ...
🌐
Formspree
formspree.io › blog › html-form-action
A Mini Guide to HTML Form Action | Formspree
February 27, 2025 - In HTML, the <form> element is the foundation for creating interactive forms. One of its most important attributes is action, which determines where the form data is sent when a user submits it.
Top answer
1 of 3
2

In forms

Action refers

to Where to send the form-data when the form is submitted

and methods refers to

The method attribute specifies how to send form-data (the form-data is sent to the page specified in the action attribute).

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

Notes on GET:

Appends form-data into the URL in name/value pairs The length of a URL is limited (about 3000 characters) Never use GET to send sensitive data! (will be visible in the URL) Useful for form submissions where a user want to bookmark the result GET is better for non-secure data, like query strings in Google

Notes on POST:

Appends form-data inside the body of the HTTP request (data is not shown is in URL) Has no size limitations Form submissions with POST cannot be bookmarked

http://www.w3schools.com/tags/att_form_action.asp

http://www.w3schools.com/tags/att_form_method.asp

2 of 3
2

<form action=""> is like <a href=""> - it specifies the URL that the browser will request when the form is submitted.

The URL for both action and href can be relative or absolute. contact.php is relative to the current page, so when a form with that action is submitted, the browser will take the current page’s URL, remove everything after the last /, append contact.php, and submit the form to that URL. E.g.

  • http://stackoverflow.com/questions/13266788/contact.php

In contrast, /contact-us/#gf_1 starts with a /, so it’s relative to the current domain. In this case, the browser will take the domain of the current page, append /contactus/#gf_1 to that, and submit the form there. E.g.

  • http://stackoverflow.com/contact-us/#gf_1

In URLs, the hash (#) character starts the fragment identifier. This refers to an anchor point on the page, indicated in the HTML by either a named anchor tag (e.g. <a name="gf_1"></a>) or an id attribute on any tag (e.g. <p id="gf_1"></p>).

By convention, when a browser goes to a URL with a fragment identifier, it will scroll the anchor point referred to by that fragment identifier into view when the page loads.

The fragment identifier is not sent to the server, so by itself it won’t have any effect on a form submission. However, JavaScript running on the page can look at the fragment identifier, and could send an AJAX request to the server based on it.

🌐
Programiz
programiz.com › html › form-action
HTML Form Action: POST and GET (With Examples)
GET and POST methods define how the form data is sent to the server. The method attribute in the element specifies how the data is sent to the server. HTTP methods declare what action is to be performed on the data that is submitted to the server. HTTP Protocol provides several methods, and the HTML Form element is able to use two methods to send user data:
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Learn › Forms › Sending_and_retrieving_form_data
Sending form data - Learn web development | MDN
November 28, 2024 - The action attribute defines where the data gets sent. Its value must be a valid relative or absolute URL. If this attribute isn't provided, the data will be sent to the URL of the page containing the form — the current page.