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. ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales@w3schools.com · If you want to report ...
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › HTML › Reference › Elements › form
<form>: The Form element - HTML | MDN
The <form> HTML element represents a document section containing interactive controls for submitting information. <form action="" method="get" class="form-example"> <div class="form-example"> <label for="name">Enter your name: </label> <input type="text" name="name" id="name" required /> </div> ...
🌐
W3Schools
w3schools.com › html › html_forms_attributes.asp
HTML Form Attributes
This chapter describes the different attributes for the HTML <form> element. The action attribute defines the action to be performed when the form is submitted.
🌐
Formspree
formspree.io › blog › html-form-action
A Mini Guide to HTML Form Action | Formspree
February 27, 2025 - This guide dives into the action ... web forms. The action attribute in an HTML <form> element specifies the endpoint where form data should be sent upon submission....
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › API › HTMLInputElement › formAction
HTMLInputElement: formAction property - Web APIs | MDN
April 10, 2025 - The formAction property of the HTMLInputElement interface is the URL of the program that is executed on the server when the form that owns this control is submitted. It reflects the value of the <input>'s formaction attribute. This property is valid only for submit and image <input> elements.
🌐
GeeksforGeeks
geeksforgeeks.org › html › html-action-attribute
HTML action Attribute - GeeksforGeeks
July 11, 2025 - The <form> element's action attribute is set to "/submit-form", indicating that when the form is submitted, the data will be sent to the /submit-form URL for processing. The method attribute is set to "post", specifying that the form data should ...
Find elsewhere
🌐
W3Schools
w3schools.com › tags › att_input_formaction.asp
HTML input formaction Attribute
<form action="/action_page.php"> <label for="fname">First name:</label> <input type="text" id="fname" name="fname"><br><br> <label for="lname">Last name:</label> <input type="text" id="lname" name="lname"><br><br> <input type="submit" value="Submit"> <input type="submit" formaction="/action_page2.php" value="Submit to another page"> </form> Try it Yourself »
🌐
DotFactory
dofactory.com › html › form › action
HTML form action
The action attribute on a <form> tag specifies the form-handler that will process the submitted form data.
🌐
Programiz
programiz.com › html › form-action
HTML Form Action: POST and GET (With Examples)
<form method="post" action="www.programiz.com/user"> <label for="firstname">First name:</label> <input type="text" name="firstname" /><br /> <label for="lastname">Last name:</label> <input type="text" name="lastname" /><br /> <input type="submit" /> </form>
🌐
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 - The action attribute is used to ... page that will process the form. The HTML form action attribute states the URL that will process the contents of a form....
🌐
HTML Form Guide
html.form.guide › html-form › form-action-using-javascript-function
Setting the Form Action with a JavaScript Function | HTML Form Guide
In the above, we assign the passed in form reference to the form variable. Then we set its action attribute with form.action = "register.html". This will result in the form’s action getting set to BASE_URL/register.html. The BASE_URL will be the URL the HTML file is running on.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Learn_web_development › Extensions › Forms › Sending_and_retrieving_form_data
Sending form data - Learn web development | MDN
The server then responds, generally handling the data and loading the URL defined by the action attribute, causing a new page load (or a refresh of the existing page, if the action points to the same page). How the data is sent depends on the method attribute. The method attribute defines how data is sent. The HTTP protocol provides several ways to perform a request; HTML form data can be transmitted via a number of different methods, the most common being the GET method and the POST method
🌐
freeCodeCamp
forum.freecodecamp.org › html-css
HTML Form Action Attribute - HTML-CSS - The freeCodeCamp Forum
April 8, 2021 - Tell us what’s happening: Your form should have an action attribute which is set to https://freecatphotoapp.com/submit-cat-photo I thought I was doing this correctly and followed the example provided but I cannot pass …
🌐
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?

🌐
W3Schools
w3schools.com › Tags › att_action.asp
HTML action Attribute
The action attribute specifies where to send the form-data when a form is submitted.
🌐
SitePoint
sitepoint.com › blog › html & css › action (html attribute)
action (HTML attribute) — SitePoint
February 13, 2024 - This element takes as its value a URL to a document that may be on the same server (for example, a shared CGI folder that has various form-processing scripts), or even a page or script on an entirely separate server (perhaps a free form-handling service). The action attribute in HTML is a critical ...
🌐
Scaler
scaler.com › topics › form-action-in-html
Form Action in HTML - Scaler Topics
May 18, 2022 - To do this processing, there is an attribute called the action attribute, which specifies where to send the form data when submitted. In short, the action attribute or form action in HTML is used to inform the browser what page to call when the submit button is pressed.
🌐
YouTube
youtube.com › watch
HTML Form Basics: Action, Method & Submission Explained for Beginners - YouTube
🚀Master the fundamentals of HTML forms with this beginner-friendly tutorial! Learn about the essential 'action' and 'method' attributes, and discover how fo...
Published   April 5, 2025
🌐
Alma Better
almabetter.com › bytes › tutorials › html › form-tag-in-html
HTML Form Tag - Action, Name, Target
June 22, 2023 - The action attribute is used to specify the URL of the server-side script that will handle the form data when the user submits the form. The value of the action attribute should be a valid URL, and can be either an absolute or a relative URL.