eXtropia: the open web technology company
Technology | Support | Tutorials | Development | About Us | Users | Contact Us
 ::   Tutorials
 ::   Presentations
Perl & CGI tutorials
 ::   Intro to Perl/CGI and HTML Forms
 ::   Intro to Windows Perl
 ::   Intro to Perl 5
 ::   Intro to Perl
 ::   Intro to Perl Taint mode
 ::   Sherlock Holmes and the Case of the Broken CGI Script
 ::   Writing COM Components in Perl

Java tutorials
 ::   Intro to Java
 ::   Cross Browser Java

Misc technical tutorials
 ::   Intro to The Web Application Development Environment
 ::   Introduction to XML
 ::   Intro to Web Design
 ::   Intro to Web Security
 ::   Databases for Web Developers
 ::   UNIX for Web Developers
 ::   Intro to Adobe Photoshop
 ::   Web Programming 101
 ::   Introduction to Microsoft DNA

Misc non-technical tutorials
 ::   Misc Technopreneurship Docs
 ::   What is a Webmaster?
 ::   What is the open source business model?
 ::   Technical writing
 ::   Small and mid-sized businesses on the Web

Offsite tutorials
 ::   ISAPI Perl Primer
 ::   Serving up web server basics
 ::   Introduction to Java (Parts 1 and 2) in Slovak


The SIZE attribute allows you to specify the width of the text field itself. Here are two examples which show the attribute being used:

And here is the code which we used to make the password fields.

    <INPUT TYPE = "PASSWORD" NAME = "demo" SIZE = "30">
    <INPUT TYPE = "PASSWORD" NAME = "demo" SIZE = "20">

introduction to web programming
The Password Widget  
A Password Widget is simply a Text Field in which the user data is masked so that nobody looking over the user's shoulder can read what was typed in. Try out the following example:

Behind the scenes, the above password field was created with the following HTML code

    <INPUT TYPE = "PASSWORD" NAME = "pass">

It is important to know that this field does not offer any form of real security. The value typed in to the password widget is still sent over the internet as unencrypted plain text. The only security this widget offers is the security of preventing an office worker from looking over your shoulder.

The Password widget also has several other attributes which affect how it works. The following table outlines them:

Attribute Description
TYPE Specifies the type of interface widget. For a password widget, you use "PASSWORD"
NAME Specifies the variable name associated with this widget
VALUE Specifies initial default text which should appear in the password field
MAXLENGTH Specifies the maximum number of characters allowed to be input into the widget
SIZE Specifies the width of the field

Let's take a closer look at each of these attributes.

The VALUE Attribute  
The VALUE attribute allows you to specify default text. Here is an example:

And here is the code which we used to make that password field.

    <INPUT TYPE = "PASSWORD" NAME = "password"
              VALUE = "default text">
The MAXLENGTH Attribute  
The MAXLENGTH attribute allows you to specify the maximum number of characters allowed for input. Here is an example which only allows you to type in 5 characters. Try it out for yourself:

And here is the code which we used to make that password field.

    <INPUT TYPE = "PASSWORD" NAME = "demo"
              MAXLENGTH = "5">
The SIZE Attribute  
Previous | Next | Table of Contents