jQuery in Action
The Form Plugin
269
In the first eight chapters of this book, we focused on the capabilities that the core
jQuery library makes available to us as page authors. But that's the tip of the ice-
berg! The immense collection of available jQuery plugins is impressive and gives us
even more tools, all based on the jQuery core, to work with.
jQuery library makes available to us as page authors. But that's the tip of the ice-
berg! The immense collection of available jQuery plugins is impressive and gives us
even more tools, all based on the jQuery core, to work with.
The creators of the core jQuery library carefully chose the functions needed by
the vast majority of page authors and created a framework on which plugins can
readily be built. This keeps the core footprint as small as possible and lets us, the
page authors, decide how we want to spend the rest of our bandwidth allowance
by picking and choosing what additional functionality is important enough to
add to our pages.
readily be built. This keeps the core footprint as small as possible and lets us, the
page authors, decide how we want to spend the rest of our bandwidth allowance
by picking and choosing what additional functionality is important enough to
add to our pages.
It'd be an impossible task to try to cover all of the jQuery plugins in the space
of a chapter, perhaps even in the space of a single book, so we had to choose
which plugins to talk about here. It was a tough call, and the plugins we included
are those that we felt were either important enough or useful enough to the
majority of web application developers to warrant coverage.
which plugins to talk about here. It was a tough call, and the plugins we included
are those that we felt were either important enough or useful enough to the
majority of web application developers to warrant coverage.
Non-inclusion of a plugin in this chapter is most certainly not an indictment
of a plugin's usefulness or quality! We just had to make some hard decisions.
You can find information on all the available plugins by visiting http://docs
query.com/plugins/most_popular.
We also can't completely cover the plugins that we will discuss, but this chapter
should give you a good basic understanding of the plugins and when they can be
applied. Consult the official documentation for each plugin to fill in any gaps in
the coverage here.
applied. Consult the official documentation for each plugin to fill in any gaps in
the coverage here.
Let's start by looking at a plugin that we previously mentioned on a number
of occasions.
9.1 The Form Plugin
Dealing with forms can be a hassle. Each control type has its particular quirks,
and form submission can often take unintended paths. Core jQuery has a number
of methods to help tame forms, but there's only so much that it can do for us. The
purpose of the official Form Plugin is to help fill these gaps and help us take con-
trol of form controls.
and form submission can often take unintended paths. Core jQuery has a number
of methods to help tame forms, but there's only so much that it can do for us. The
purpose of the official Form Plugin is to help fill these gaps and help us take con-
trol of form controls.
This plugin can be found at http://jquery.com/plugins/project/form and resides
in the file jquery.form.js.