Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
16.3 Text Controls
395
TARGET
The
TARGET
attribute is used by frame capable browsers to determine
which frame cell should be used to display the results of the servlet or
other program handling the form submission. The default is to display
the results in whatever frame contains the form being submitted.
ONSUBMIT and ONRESET
These attributes are used by JavaScript to attach code that should be
evaluated when the form is submitted or reset. For
ONSUBMIT
, if the
expression evaluates to
false
, the form is not submitted. This case lets
you invoke JavaScript code on the client that checks the format of the
form field values before they are submitted, prompting the user for
missing or illegal entries.
ACCEPT and ACCEPT CHARSET
These attributes are new in HTML 4.0 and specify the MIME types
(
ACCEPT
) and character encodings (
ACCEPT CHARSET
) that must be
accepted by the servlet or other program processing the form data. The
MIME types listed in
ACCEPT
could also be used by the client to limit
which file types are displayed to the user for file upload elements.
16.3 Text Controls
HTML supports three types of text input elements: textfields, password
fields, and text areas. Each is given a name, and the value is taken from the
content of the control. The name and value are sent to the server when the
form is submitted, which is typically done by means of a submit button (see
Section 16.4).
Textfields
HTML Element:
(No End Tag)
Attributes:
NAME
(required),
VALUE
,
SIZE
,
MAXLENGTH
,
ONCHANGE
,
ONSELECT
,
ONFOCUS
,
ONBLUR
,
ONKEYDOWN
,
ONKEYPRESS
,
ONKEYUP
This element creates a single line input field where the user can enter text, as
illustrated earlier in Listings 16.1, 16.2, and 16.3. For multiline fields, see
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
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