开发者

value of input not posted

<script type="text/javascript" language="javascript">
    $(function() {

    $("#distributor").autocomplete({
   开发者_StackOverflow社区         source: function(request, response) {
                $.ajax({
                    url: "/Devices/autoDistributor", type: "POST", dataType: "json",
                    data: { name: request.term, maxResults: 10 },
                    success: function(data) {
                        response($.map(data, function(item) {
                            return { value: item.Name }
                        }))
                    }
                })
            },
            select: function(event, ui) {
            //alert(ui.item.value);

            }
        });


    });
</script>

   <% using (Html.BeginForm("Filtering","Devices",FormMethod.Post)) {%>


   Distributor: <input id="distributor" type="text"/>

   <input id="finish_button" type="submit" value="Search"  />


  <% } %>

When i post form, text who is inserted in input (id="distributor") is not posted, why???


Your <input> is missing the name attribute, like this:

<input id="distributor" name="distributor" type="text"/>

Without this, it doesn't get serialized/submitted when the <form> does :)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜