HTML and CSS Reference
In-Depth Information
Finally, you might want to consider validating form input through scripting. Using
JavaScript, you can embed small programs in your web pages. One common use for
JavaScript is writing programs that verify a user's input is correct before she submits a
form. I discuss JavaScript in more detail in Lesson 14.
As you can see, the wonderful world of forms is full of different types of form controls
for your visitors. This truly is a way to make your web pages interactive.
Be cautious, however. Web surfers who are constantly bombarded with forms are likely
to get tired of all that typing and move on to another site. You need to give them a reason
for playing!
Table 11.1 summarizes the HTML tags used today. Remember these points and you can't
go wrong:
Use the form element to create your forms.
Always assign an action to a form.
Create form controls with the input element or the other form control elements.
Test your forms extensively.
TABLE 11.1
HTML Tags Used in this Lesson
Creates an HTML form. You can have multiple forms within a docu-
ment, but you cannot nest the forms.
An attribute of <form> that indicates the server-side script (with a
URL path) that processes the form data.
An attribute of the <form> tag that specifies how form data is
encoded before being sent to the server.
An attribute of <form> that defines how the form data is sent to the
server. Possible values are get and post .
A <form> element that creates controls for user input.
An attribute of <input> that indicates the type of form control.
Possible values are shown in the following list:
Creates a single-line text entry field.
Creates a single-line text entry field that masks user input.
Creates a Submit button that sends the form data to a server-side
Search WWH ::

Custom Search