Click here to Skip to main content
12,627,681 members (33,198 online)
Click here to Skip to main content
Articles » Web Development » Ajax » Libraries » Downloads

Stats

32.5K views
2.1K downloads
47 bookmarked
Posted

A Watermarked Auto-complete jQuery Plugin

, 20 Aug 2011 CPOL
This article presents a watermarked auto-complete jQuery plugin
Watermarkautocomplete
Watermarkautocomplete
Watermarkautocomplete.suo
bin
Content
redmond
images
ui-bg_flat_0_aaaaaa_40x100.png
ui-bg_flat_55_fbec88_40x100.png
ui-bg_glass_75_d0e5f5_1x400.png
ui-bg_glass_85_dfeffc_1x400.png
ui-bg_glass_95_fef1ec_1x400.png
ui-bg_gloss-wave_55_5c9ccc_500x100.png
ui-bg_inset-hard_100_f5f8f9_1x100.png
ui-bg_inset-hard_100_fcfdfd_1x100.png
ui-icons_217bc0_256x240.png
ui-icons_2e83ff_256x240.png
ui-icons_469bdd_256x240.png
ui-icons_6da8d5_256x240.png
ui-icons_cd0a0a_256x240.png
ui-icons_d8e7f3_256x240.png
ui-icons_f9bd01_256x240.png
Controllers
Global.asax
Models
Properties
Scripts
Watermarkautocomplete.csproj.user
$(document).ready(function () {
    var dataSourceUrl = "DataSource/GetData";
    var maxResult = 5;

    // Prepare a simple option object
    var options = {
        autocompletesource: function (request, response) {
            var term = $.trim(request.term);
            var dataToServer = { searchText: term, maxResults: maxResult };

            $.ajax({
                url: dataSourceUrl, type: "POST", dataType: "json",
                data: dataToServer, success: function (data) {
                    response($.map(data, function (v) {
                        var Id = v.Id;
                        var Name = v.Name;
                        return { label: Name, value: Name, Id: Id };
                    }));
                }
            });
        }
    };

    // Set up the watermarked autocomplete text box
    $("#txtAutoComplete").watermarkAutocomplete(options);
});

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Dr. Song Li
United States United States
I have been working in the IT industry for some time. It is still exciting and I am still learning. I am a happy and honest person, and I want to be your friend.

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.161205.3 | Last Updated 20 Aug 2011
Article Copyright 2011 by Dr. Song Li
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid