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 OverflowVideos
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.
action="" will resolve to the page's address. action="#" will resolve to the page's address + #, which will mean an empty fragment identifier.
Doing the latter might prevent a navigation (new load) to the same page and instead try to jump to the element with the id in the fragment identifier. But, since it's empty, it won't jump anywhere.
Usually, authors just put # in href-like attributes when they're not going to use the attribute where they're using scripting instead. In these cases, they could just use action="" (or omit it if validation allows).
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?