10 out of 12 rated this helpful - Rate this topic

input type=password element | input type=password object

[This documentation is preliminary and is subject to change.]

Creates a single-line text entry control similar to the INPUT type=text control, except that text is not displayed as the user enters it.

HTML 4.01 Specification, Section 17.4

Standards information

HTML information

Closing Tagforbidden
CSS Displayinline

DOM Information

Inheritance Hierarchy

 Node
  Element
   HTMLElement
     input type=password

Remarks

Security Warning:  Using this object incorrectly can compromise the security of your application. Passwords submitted through INPUT type=password are not encrypted and therefore not secure. Using Secure Hypertext Transfer Protocol (HTTPS) is strongly recommended. You should also use the post method for submitting passwords. This submission method hides the password from most users by placing it in the HTTP header. The get method submits the password as part of the URL string, which might be exposed in the Address bar and the status bar. You should review the Security Considerations: Dynamic HTML before continuing.

Examples

The following example uses the INPUT type=password element to define a password field.


Username <INPUT TYPE=button ID=txtUser>
Password <INPUT TYPE=password ID=txtPassword>

The following example uses script to determine whether the password is valid for the specified user.


<SCRIPT>
if (txtUser.value == "Paul")
   if (txtPassword.value == "2ifbysea")
   {
      alert("Password accepted.  Enjoy your ride.");
      return true;
   }
</SCRIPT>

See also

input
input

 

 

Build date: 3/8/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ