jQuery in Action

The Form Plugin
271
button controls, are always considered unsuccessful and never participate in a
form submission. Others, like
<select>
controls, must have a selected value to be
considered successful.
The
fieldValue()
command gives us the choice whether to include unsuccess-
ful values or not; its syntax is as follows:
We've set up another handy lab page to demonstrate the workings of this com-
mand. You'll find this page in the file chapter9/form/lab.get.values.html; when
displayed in your browser, it will appear as shown in figure 9.1.
Command syntax: fieldValue
fieldValue(excludeUnsuccessful)
Collects the values of all successful form controls in the wrapped set and returns them as
an array of strings. If no values are found, an empty array is returned.
Parameters
excludeUnsuccessful
(Boolean) If true or omitted, specifies that any unsuccessful
controls in the wrapped set be ignored.
Returns
A String array of the collected values.
Figure 9.1 The Get Form Values Laboratory helps us to understand the operation of the
fieldValue()
and the
serialize()
commands.


Другие страницы

 
Cкачать книги бесплатно без регистрации в электронном виде (pdf, chm, txt).Вы можете читать книги онлайн на нашем сайте литературного портала книг.Большая подборка учебников, пособий, интересных книг.Электронные книги на английском языке скачать бесплатно без смс.