Rendered by default as boxes that are checked (ticked) when activated
value
A string representing the value of the checkbox
This is not displayed on the
client-side, but on the server this is the
value given to the data submitted with the checkbox's name
The value attribute is one which all input elements share
However, it serves a special purpose for inputs of type checkbox
When a form is submitted, only checkboxes which are currently
checked are
submitted to the server, and the reported
value is the value of the value attribute.
If the value is not otherwise specified, it is
the string on by default
checked
A boolean attribute indicating whether this checkbox is checked by default
(when the page loads)
It does not indicate
whether this checkbox is currently checked
If the checkbox's state is changed,
this content attribute does not reflect the change
Only the HTMLInputElement's checked IDL attribute is
updated
Radio buttons are similar to checkboxes, but with an important distinction
Same-named radio buttons are grouped into a set in which only one
radio
button can
be selected at a time, whereas checkboxes allow you to turn
single values on
and off
Where multiple same-named controls exist, radio buttons allow one to be
selected
out of them all, whereas
checkboxes allow multiple values to be selected.
input elements of type email are used to let the user
enter and edit an email
address, or, if the multiple attribute
is specified, a list of email addresses
The input value is automatically validated to ensure that it's either
empty or a
properly-formatted email address (or
list of addresses) before the form can be submitted.
The :valid and :invalid CSS pseudo-classes are automatically applied as appropriate
to visually denote whether the
current value of the field is a valid email address or not.
value
The input element's value attribute contains a string which is
automatically validated as conforming to email syntax.
More specifically, there are three possible value formats that will pass validation:
An empty string ("") indicating that the user did not enter a value or that
the
value was removed.
A single properly-formed email address. Checks only if email is
formatted correctly: username@domain or
username@domain.tld. Can also validate with regular expression
If the multiple attribute is specified, the value can be a list
of
properly-formed comma-separated email
addresses
maxlength
The maximum string lengththat the user can enter into the email input
minlength
The minimum string length that the user can enter into the email input. This must be
a
non-negative integer value smaller than or equal to the value specified by maxlength
multiple
A Boolean attribute which, if present, indicates that the user can enter a list of
multiple email addresses, separated
by commas and, optionally, whitespace characters
size
The size attribute is a numeric value indicating how many characters wide
the input field should be
The value must be a
number greater than zero, and the default value is 20
This does not set a limit on how many characters the user can enter into the
field. It only specifies approximately how
many can be seen at a time.
placeholder
The placeholder attribute is a string that provides a brief hint to the user as to
what kind of information is expected
in the field
input
elements of type hidden let web developers include data that cannot be seen or modified
by users when a form is submitted
Hidden inputs are completely invisible in the rendered page, and there is no way to make
it
visible in the page's
content.
While the value isn't displayed to the user in the page's content, it is visible—and can
be
edited—using any browser's
developer tools or "View Source" functionality
Example (type=image)
HTML
<input
type="image"
src="../images/myButton2.png"
alt="click me"
formaction="https://phptwo.tomgdow.com"
formmethod="GET">
Notes
input elements of type image are used to create graphical
submit buttons, i.e. submit buttons that take the form of an
image rather than text
(MDN) When you submit a form using a button created with input type="image"extra data
points are submitted to the
server automatically by the browser — x and y
value
input elements of type imagesdo not accept
value attributes
The path to the image to be displayed is specified in the src
attribute
alt
The alt attribute provides an alternate string to use as the button's label
if the image cannot be shown
formaction
A string indicating the URL to which to submit the data
This takes precedence over the action attribute on the
form element
d that owns the input
This attribute is also available on input type=submit and
button elements
formenctype
A string that identifies the encoding method to use when submitting the form
data to the server
There are three permitted values
application/x-www-form-urlencoded
This, the default value, sends the form data as a string after URL
encoding (percent encoding) the text using an algorithm such as
encodeURI()
multipart/form-data
Uses the FormData API to manage the data, allowing
for files to be submitted to the server.
You must use this encoding
type if your form includes any input elements of
type file
text/plain
Plain text; mostly useful only for debugging, so you can easily see the
data that's to be submitted
If specified, the value of the formenctype attribute overrides the
owning form's action attribute
formmethod
A string indicating the HTTP method to use when submitting the form's data
This value overrides any method attribute
given on the owning form
Permitted values are:
get
post
dialog
formtarget
A string which specifies a name or keyword that indicates where to display the
response received after submitting the
form