input type="password" ElementThe input type="password" element is an inline element declared by the XHTML 1.1 Forms Module
Elements in the Forms Module are:form | label | textarea | select | optgroup | option | button | fieldset | legend | input type="button" | input type="checkbox" | input type="file" | input type="hidden" | input type="image" | input type="password" | input type="radio" | input type="reset" | input type="submit" | input type="text"
The input type="password" element is used within a
form to provide a single-line text
box where the text is obscured, character by character, as it is entered.
This prevents onlookers from viewing the text within the box:
usually each character is represented on-screen as an asterisk.
As the element's name suggests, input type="password"
fields are typically used for password entry.
Important: When the
form containing an
input type="password" element is submitted,
the password is transmitted (as is all form data) in clear text.
This means that a password box must be used in conjunction with a suitably
secure and encrypted connection if the password is to be transmitted safely.
The width of the password box may be specified using the
size attribute.
The maxlength
attribute may be used to specify the maximum number of characters which the user
is allowed to enter. The user agent should prevent the user from entering more
characters than this maximum number. Note, however, that processing code should
not assume that
it will never receive a value longer than this: quite apart from anything else,
it is far from difficult to submit arbitrary input data to your processor
without using a conventional browser.
The content of the
value attribute
(if present) is placed in the password box (in a obscured fashion, commonly a series of
asterisks) when the form is first rendered. The user may then edit
the text (provided the element is not
disabled or
readonly)
and the final edited text is sent to
the processing URI as the value in a name=value pair.
Here is an example using the input type="password" element:
<label for="pword">Password:</label>
<input type="password" id="pword" name="pword" size="20" maxlength="16" />
This renders as:
See also the input type="text" element for
the entry of short lengths of normal, unobscured, text.
Although the type attribute is not #REQUIRED
on the input element, its default value is "text" and so must be present on input type="password".
input type="password" element are listed below:accesskey [ type Character ]input element to allow text inputdisabled [ type Boolean ]maxlength [ type Number ]name [ type CDATA ]name attribute is not present, the value of the password field will not be sent). The value sent (in a name=value pair) is the text in the password field at the time of submission.Important Note: Although the password is hidden from onlookers by having the characters appear as (typically) only a string of asterisks in the input field, the value itself is sent in clear text to the processing URI. A suitably secure and encrypted connection should be used to protect sensitive data.
Note: Although technically optional, a note in the *Forms Module DTD says that the name attribute is required on all input elements except "submit" and "reset"
readonly [ type Boolean ]size [ type Number ]tabindex [ type Number ]value [ type CDATA ]onblur [ type Script ]onchange [ type Script ]onfocus [ type Script ]onselect [ type Script ]input type="password" element are listed below:class [ type NMTOKENS ]id [ type ID ]style [ type CDATA ], from the Style Attribute Module (deprecated)title [ type Text ]xmlns [ type URI - #FIXED 'http://www.w3.org/1999/xhtml' ]dir [ type Enumeration (ltr | rtl) ], from the Bi-directional Text Modulexml:lang [ type LanguageCode ]All attributes in the
Events Attribute Collection
are supported:onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup
input type="password" element is:
EMPTY
See Content Model & Nesting for information about Content Model syntax and Nesting Groups.
input type="password"This element is empty and may have no children.
input type="password"abbr, acronym, address, cite, code, dfn, div, em, h1 - h6, kbd, p, q, samp, span, strong, varadd, dt, licaption, td, thfieldset, label, legendb, big, i, small, sub, sup, ttdel, insbdoobjectrb, rt