Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
16.3 Text Controls
397
ted, the form data simply consists of the name and an equal sign (e.g., 
other data&textfieldname=&other data
).
SIZE
This attribute specifies the width of the textfield, based on the average 
character width of the font being used. If text beyond this size is 
entered, the textfield scrolls to accommodate it. This could happen if 
the user enters more characters than the 
SIZE
 or enters 
SIZE
 number 
of wide characters (e.g., capital W) if a proportional width font is being 
used. Netscape automatically uses a proportional font in textfields. 
Internet Explorer, unfortunately, does not, and you cannot change the 
font by embedding the 
INPUT
 element in a 
FONT
 or 
CODE
 element.
MAXLENGTH
MAXLENGTH
 gives the maximum number of allowable characters. This 
number is in contrast to the number of visible characters, which is spec 
ified via 
SIZE
.
ONCHANGE, ONSELECT, ONFOCUS, ONBLUR, 
ONDBLDOWN, ONKEYPRESS, and ONKEYUP
These attributes are used only by browsers that support JavaScript. 
They specify the action to take when the mouse leaves the textfield after 
a change has occurred, when the user selects text in the textfield, when 
the textfield gets the input focus, when it loses the input focus, and 
when individual keys are pressed. 
Password Fields
HTML Element:
 
(No End Tag)
Attributes:
NAME
 (required), 
VALUE
, 
SIZE
, 
MAXLENGTH
, 
ONCHANGE
, 
ONSELECT
, 
ONFOCUS
, 
ONBLUR
, 
ONKEYDOWN
,
ONKEYPRESS
, 
ONKEYUP
Password fields are created and used just like textfields, except that when the
user enters text, the input is not echoed but instead some obscuring charac 
ter, usually an asterisk, is displayed (see Figure 16 9). Obscured input is use 
ful for collecting data such as credit card numbers or passwords that the user
would not want shown to people who may be near his computer. The regular,
unobscured text is transmitted as the value of the field when the form is sub 
mitted. Since 
GET
 data is appended to the URL after a question mark, you
Second edition of this book: www.coreservlets.com; Sequel: www.moreservlets.com.
Servlet and JSP training courses by book's author: courses.coreservlets.com.






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

jsp web hosting

 

Our partners: PHP: Hypertext Preprocessor Best Web Hosting Java Web Hosting Jsp Web Hosting Cheapest Web Hosting

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved