Quantcast
Channel: Internet Explorer Web Development forum
Viewing all articles
Browse latest Browse all 3527

MVC application JQuery-UI AutoComplete MinLength and Select not working

$
0
0

In a MVC application, I have JQuery-UI AutoComplete textbox which fetches data from database. MinLength and Select not working. I have uploaded the complete project including the DBScript and DB backup at location : https://drive.google.com/file/d/0B6vvhyjkwQ8eMzVQNUJmaUtQMWc/edit?usp=sharing

$(document).ready(function () {
            $("#txtPublisherName").autocomplete({
                source: function(request,response) {
                    $.ajax({
                        url: "/Publisher/SearchPublisherByName",
                        type: "POST",
                        dataType: "json",
                        data: { term: request.term },
                        success: function (data) {
                            response($.map(data, function (item) {
                                return { id: item.Id, label: item.Name, value: item.Name };
                            }
                          ))
                        },
                        select: function (event, ui) {
                            $("#publisherId").val(ui.item.value);
                            return true;
                        }, minLength: 4
                    })
                },
                messages: {
                    noResults: "", results: ""
                }
            });
        })


Viewing all articles
Browse latest Browse all 3527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>