开发者

Autocomplete Jquery plugin

开发者 https://www.devze.com 2023-02-20 07:23 出处:网络
I am using Autocomplete Jquery from the following URL: http://jqueryui.com/demos/autocomplete/ I am making my project in MVC 3.0 (Raz开发者_如何学Cor)

I am using Autocomplete Jquery from the following URL: http://jqueryui.com/demos/autocomplete/

I am making my project in MVC 3.0 (Raz开发者_如何学Cor) In this I am displaying list of names from the database and its running fine. Now I want to show this whole list in the div according to my project requirement.

Please help how can I display the Autocomplete data in the div.


Straight from the jQuery UI documentation (remote example):

$(function() {

    // This function sets the results inside a div with id = 'log'
    function log( message ) {
        $( "<div/>" ).text( message ).prependTo( "#log" );
        $( "#log" ).attr( "scrollTop", 0 );
    }


    $( "#birds" ).autocomplete({
        source: "search.php",
        minLength: 2,
        select: function( event, ui ) {
            log( ui.item ? "Selected: " + ui.item.value + " aka " + ui.item.id :
                "Nothing selected, input was " + this.value );
        }
    });
});

<div id="log"></div>
0

精彩评论

暂无评论...
验证码 换一张
取 消