What are HTML Forms?
Form elements are different types of input elements, like text fields, checkboxes, radio buttons, submit buttons, and more.
If the action attribute is omitted, the action is set to the current page.
The <input> element is the most important form element. It can be displayed in several ways, depending on the type attribute.
|<input type="text"> For one-line text input field|
|<input type="radio"> Defines a radio button|
|<input type="submit"> Defines a submit button|
The action attribute defines the action to be performed when the form is submitted. Normally, the form data is sent to a web page on the server when the user clicks on the submit button.
The target attribute specifies if the submitted result will open in a new browser tab, a frame, or in the current window.
The default value is "_self" which means the form will be submitted in the current window. To make the form result open in a new browser tab, use the value "_blank":
|<form action="/action_page.php" target="_blank">|
Other legal values are "_parent", "_top", or a name representing the name of an iframe.
The method attribute specifies the HTTP method (GET or POST) to be used when submitting the form data:
|<form action="/action_page.php" method="get">|
Tech writer at newsandstory
Total 147 views