HTML and CSS Reference
In-Depth Information
Table 11.3 Methods of the document Object (continued)
What It Does
Brings the document into focus.
Returns a reference to the first object with the specified ID.
Returns a collection of objects with the specified name.
Returns a collection of objects with the specified tag name.
Begins a new document, erasing the old one.
Writes and appends text into the current document.
Same as write() , but appends a newline if in a <pre> tag.
11.3 About HTML Forms
At the heart of the Web is the form. It is used to pass information from the browser to
the server. Anytime you go online and order a book, trade at an auction, fill out a survey,
or send an e-mail using a Web browser, you are working with a form.
An HTML form offers you a number of ways to accept input, such as radio buttons,
checkboxes, popup menus, hidden fields, and textboxes; these are called virtual input
devices or controls. Once the form has been filled out by a user, it normally is sent to a
server where the input is processed by a server-side program, such as a Java servlet, CGI,
ASP.NET, or PHP application. It is important to understand how the form data is col-
lected and sent to the server and then what role JavaScript has in this process.
11.3.1 Attributes of the < form >Tag
All forms are in HTML documents. They begin with a <form> tag and its attributes, fol-
lowed by the input fields where the user enters form information, and end with a
</form> tag.
<form name="form1" id="form1"
action="URL to server program"
<input type="text" name="town" id="town" />
(continue here with body of the form
including input devices for
filling out the form;
see Table 11.4 for a complete example).
Search WWH ::

Custom Search