Tuesday 31 March 2015

Autocomplete using Jquery.



    Below is the code for autocomplete using Jquery .

        > <head> <meta charset="utf-8">
        > <title>Autocomplete using
        > jQuery</title> <link rel="stylesheet"

    Contains style classes for AUTOCOMPLETE

        > href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
        ><script src="http://code.jquery.com/jquery-1.9.1.js"></script>

    Contains functions for AUTOCOMPLETE :

         ><script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
         ><script>

    'Autocomplete' provides suggestions when you type into the textbox, here which are stored

in a JavaScript array.

        <p>$(function() {<br>

    BELOW ARRAY CONTAINS ALL THE NAMES TO DISPLAY ON AUTOCOMPLETE 'EMP NAME' TEXT BOX

    copytext

            var empNames = [
            "Amit",
            "Aman",
            "Raman",
            "Brijesh",
            "Rakesh",
            "Akshay",
            "Arohi",
            "Sita",
            "Saumya",
            "Deepak",
            "Shailesh",
            "Arpit"];
        $( "#names" ).autocomplete({
            source: empNames
            });
        });
        </script>
        </head>
        <body>
        <div class="ui-widget">
        <label for="names">Emp Names: </label>
        <input id="names">
        </div>
        </body>
        </html>

For such more blogs kindly visit http://findnerd.com/NerdDigest

No comments:

Post a Comment