Learn jquery from scratch (11) Actual combat form verification and auto Completion prompt plugin

Source: Internet
Author: User

I. Summary

This series of articles will take you into the wonderful world of jquery, with many authors ' specific experiences and solutions, even if you can use jquery to find some cheats in your reading.

This article is about the two most commonly used jquery plug-ins. For form verification and AutoComplete prompts (similar to Google suggest).

Two. Foreword

Studying other people's work is a time-consuming and painful process. Of course, and my English is not good. Always feel that the control author has written a lot of documents but not enough system, need to study a lot of examples to understand the author's thinking. So learning and researching a plugin requires a high cost, It is also unknown if bugs are found and the cost is fixed (this time I spent less time solving a bug in Chinese that automatically completes the hint plugin, but if the complex bugs are not so simple.).

For simple applications I first recommend the jquery UI above. But the jquery UI solves a limited problem. Using the jquery plugin is our last good idea---is a good idea, at least better than our own development?

A lot of jquery's plug-in code is exceptionally beautiful, look at the Art Dragon home now the city input box control, in addition to the need to manually add many many attributes for the input box (Onkeyup,onkeydown, etc.), but not universal, Consumes server resources and network resources. But it was also a work that took a long time to complete.

Standing on the shoulders of giants, it makes me feel like writing scripts and writing design C # programs, all have the height and depth to dig. In addition to using the features developed by authors, you can learn how to develop and encapsulate JavaScript controls. After looking at the good jquery plugin author's code and design ideas, Often since sigh design level gap incredibly so big, increase since think script expert, compare is C # programmer and architect Gap.

I hope you will be able to learn how to encapsulate and design JavaScript controls in addition to how you can use the two plug-ins introduced in this chapter.

Three. Form verification plug-in Validate

You often validate user input before submitting a form. Asp. NET is used for this purpose and can be both client and server-side validation. However, validation controls are not used by all projects. And you often use your own client-side validation framework in MVC projects.

After comparing several form verification plug-ins, you decide to adopt the Validate plug-in. Because it is easy to use and flexible.

Plug-in home:

http://bassistance.de/jquery-plugins/jquery-plugin-validation/

Plugin Documentation:

Http://docs.jquery.com/Plugins/Validation

Configuration Description:

Http://docs.jquery.com/Plugins/Validation/validate#options

1. Application examples

Instance effect:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.