阅读背景:

如何从自动完成jquery函数中获取所需的值?

来源:互联网 

My Jquery function:

我的Jquery功能:

<script type="text/javascript">

function Origin(sender, args) {

    $(function () {
        $("#<%=txtInfo.ClientID %>").autocomplete({
            source: function (request, response) {
                $.ajax({
                    url: '<%=ResolveUrl("~/Webservice.asmx/Get") %>',
                    data: "{ 'prefix': '" + request.term + "'}",
                    dataType: "json",
                    type: "POST",
                    async: false,
                    mustMatch: true,
                    contentType: "application/json; charset=utf-8",
                    success: function (data) {
                        response($.map(data.d, function (item) {
                            return {
                                label: item.split('-')[0],
                                val: item.split('-')[1]
                            }
                        }))
                    },
                    error: function (response) {

                    },
                    failure: function (response) {

                    }
                });
            },

            select: function (e, i) {

                $("#<%=hdnInfo.ClientID %>").val(i.item.val);

                info1()                     

            },                    
            minLength: 0
        }).bind('focus', function () { $(this).autocomplete("search"); });              

        });
   }       

</script>
<script typ



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: