Page 64 - DCAP408_WEB_PROGRAMMING
P. 64
Web Programming
Notes
Figure 2.6
Notes The contents list of name/value pairs excludes unselected radio buttons and
checkboxes. In general, any field with a null value can be omitted from the contents list.
Client-side Scripts and fill-out Forms
HTML 3.0 doesn’t provide direct support for constraining the values entered into text fields, or
for derived fields whose values are calculated from the values of other fields. Rather than
extending the markup to support these features, HTML 3.0 provides a means for associating the
form with a script. Support for scripts is not required, however, and the HTML 3.0 specification
doesn’t cover the scripting languages or the details of their interface with the user agent.
The SCRIPT attribute of the FORM element specifies the script via a URI. The user agent downloads
the script and interprets it locally. Scripts handle a variety of messages for individual fields and
the form as a whole. These messages correspond to events such as:
Enter/Leave Form (for initialization and clean up)
When a field gains or loses the input focus
Mouse clicks and drags over a field
Keyboard events
58 LOVELY PROFESSIONAL UNIVERSITY