what do form action= # and form method= post action= # do?
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.
what do form action=“.”
Form Action attribute specifies where to send the form-data when a
form is submitted
Possible accepted 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")
in your case of action="."
you are pointing to current url/file/directory.
So it will reload the same page on form submission.
What is form action= # ?
An action of "#" indicates that the form stays on the same page, simply suffixing the URL with a #.
What does an entry action='.' in html form mean?
.
is the current path segment of the current URL. In other words, it refers to the current relative URL.
If your current URL is http://example.com/foo/bar/baz/
, then .
refers to http://example.com/foo/bar/baz/
(yes, same URL).
It's a bit trickier without a trailing slash. On http://example.com/foo/bar/baz
, .
refers to http://example.com/foo/bar/
. That's why it's not usually a good idea to use .
; you could use action=""
instead, which means action
has an empty value, in which case the current (full) URL is substituted.
This .
is pretty universal and is used in many contexts involving URLs or file paths.
Related Topics
Using Text-Align Center in Colgroup
Why Does My Transform Snap Back
Html5 Video // Completely Hide Controls
Audio Tag Autoplay Not Working in Mobile
Remove Blur Effect on Child Element
How to Embed a PDF Viewer in a Page
Html5 Video Element Request Stay Pending Forever (On Chrome)
How to Convert Nsattributedstring into HTML String
How to Set Height for the Drop Down of Select Box
How to "Crop" a Rectangular Image into a Square with CSS
Get Rid of Space Underneath Inline-Block Image
How to Set Style to Title Tag in Header
How Does One Use the Onerror Attribute of an Img Element
Why Should I Not Use HTML Frames
Why Is an Element with Position: Fixed Moving with a Non-Positioned Sibling
Disable Spell-Checking on HTML Textfields