views:

42

answers:

1

Can somebody post a simple html code on how to implement it,with simple data object.

Here is the link http://code.drewwilson.com/entry/autosuggest-jquery-plugin

I have tried everything to get it working and i have not succeeded so far, can somebody please help

Thanks

Mason

+1  A: 

This seems to work fine (basically got it right off the website), probably need some styling to get it like you want it. Also not sure where your data will come from, but he's got some ajax examples on their as well.

Anyway, Save the following as an .html document for an example.

<html>
<head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt; 
    <script src="http://the-know-your-rights.googlecode.com/svn-history/r10/trunk/resources/js/jquery/autoSuggest/jquery.autoSuggest.minified.js"&gt;&lt;/script&gt;
    <script type="text/javascript">
        var $sel = null;
        $(document).ready(function () {
          var data = {items: [
                {value: "21", name: "Mick Jagger"},
                {value: "43", name: "Johnny Storm"},
                {value: "46", name: "Richard Hatch"},
                {value: "54", name: "Kelly Slater"},
                {value: "55", name: "Rudy Hamilton"},
                {value: "79", name: "Michael Jordan"}
            ]};
            $("input[type=text]").autoSuggest(data.items, {selectedItemProp: "name", searchObjProps: "name"});
        });
    </script>
</head>
<body>
    <input type="text" />
</body>
</html>

If this isn't what you're looking for then update your question with more specifics, and I'll see if I can get you a better answer.

Brandon Boone
Thanks man i have clicked the tick and the up sign
Glad I was able to help!
Brandon Boone