Java Reference
In-Depth Information
In addition to there being a Reset button, which is discussed later in the chapter, the
Form
object has
the
reset()
method, which clears the form, or restores default values if these exist.
Creating blank forms is not exactly exciting or useful, so now let's turn our attention to the HTML
elements that provide interaction functionality inside forms.
html elements in forms
About ten elements are commonly found within
<form/>
elements. The most useful are shown
in Figures 11-1, 11-2, 11-3, and 11-4, ordered into general types. Each type name is given and,
in parentheses, the HTML needed to create it, though note this is not the full HTML but only a
portion. The new HTML5 form controls are not listed here; you examine them later in the chapter.
As you can see, most form elements are created by means of the
<input/>
element. One of the
<input/>
element's attributes is the
type
attribute. It's this attribute that decides which of the
form elements this element will be. Examples of values for this attribute include
button
(to create a
button) and
text
(to create a text box).
figure 11-2
figure 11-1
figure 11-3
figure 11-4