Ive seen people who put "#" in the action attribute for the form tag. could someone explain what that does?
<form action="#" method="post" name="Form" id="Form">
Ive seen people who put "#" in the action attribute for the form tag. could someone explain what that does?
<form action="#" method="post" name="Form" id="Form">
An action of "#" indicates that the form stays on the same page, simply suffixing the URL with a #.
It resolves to the top of the current URL (eliminating any existing fragment id on the URL).
That is an URL where the server part is empty, there is a bookmark separator, and the bookmark is empty.
The URL that will be used is the same as the current page.
When the response from posting the form arrives, the bookmark will be added to the URL (the bookmark is never sent to the server) and the empty bookmark is the top of the page. As the page is already loaded with the top of the page at the top of the window, the bookmark has no effect.
As others replied,it will stay in the current page. Apart from the form tag we can use "#" in tag as well. Using # we can create a link to another section of the same page.