Java Reference
In-Depth Information
The following step enters the code to clear the stock quote text area.
To Clear the Stock Quote Text Area
1. Enter lines 29 through 34 as shown in Figure 12-65 on page 841.
TextPad displays the JavaScript function, clearQuote(), in the coding window
(Figure 12-67). Changing the value of a text area replaces the contents dis-
played to the user with the new value. Setting the value to an empty string
clears the text area.
clearQuote()
JavaScript
function
textarea cleared
FIGURE 12-67
Because multiple functions performing different processes also must set the
hidden form field data and submit the form, a function, setAction(), is used to
execute the common code (lines 35 through 39 in Figure 12-65). The hidden
form input field, WSaction, is not seen by the user; however, its value is passed
to the server just like any other form field. The value for the hidden field is
obtained from the function parameter. The setAction() function then calls the
form submit() built-in function, which causes the form data to be submitted to
the server, in the same manner as if the user clicked a submit button.
Search WWH ::




Custom Search