Placeholders
Checkboxes
Checkboxes are form controls that only have 2 states: checked or unchecked. They basically allow the user to say “Yes” or “No” to something.
By default, a checkbox input is unchecked. You can mark it as checked by using the simply called checked attribute.
Radio buttons
You can present the user a list of options to choose from by using radio buttons.
For this form control to work, your HTML code needs to group a list of radio buttons together. This is achieved by using the same value for the name attribute:
Single
Married
Divorced
Widowed
Multiple choice dropdown menus
The Submit Button
defines a button for submitting the form data to a form-handler.
The form-handler is typically a server page with a script for processing input data.
The form-handler is specified in the form's action attribute:
The Action Attribute
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
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.
The method attribute specifies the HTTP method (GET or POST) to be used when submitting the form data:
The default method when submitting form data is GET.
However, when GET is used, the submitted form data will be visible in the page address field:
Notes on GET:
Appends form-data into the URL in name/value pairs
The length of a URL is limited (about 3000 characters)
Never use GET to send sensitive data! (will be visible in the URL)
Useful for form submissions where a user want to bookmark the result
GET is better for non-secure data, like query strings in Google
Always use POST if the form data contains sensitive or personal information. The POST method does not display the submitted form data in the page address field.
Notes on POST:
POST has no size limitations, and can be used to send large amounts of data.
Form submissions with POST cannot be bookmarked
Материалы на данной страницы взяты из открытых источников либо размещены пользователем в соответствии с договором-офертой сайта. Вы можете сообщить о нарушении.