This is a migrated thread and some comments may be shown as answers.

[Solved] BeginForm in Splitter

0 Answers 10 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
mina
Top achievements
Rank 1
mina asked on 19 Dec 2012, 08:42 AM
Hi
I use @html.BeginForm()  in  a pans of splitter but, not work  form.serialize()  in jquery

this  is my code 
Html.Exir().Splitter().Name("SearchSpritter")
        .HtmlAttributes(new { style = "height: 630px; border-color:#F5F5F5; " })
        .Orientation(SplitterOrientation.Horizontal)
        .Panes(panes =>
               {
                   panes.Add()
                       .Content(@<p>
                                     Center pane</p>);
                   panes.Add()
                       .Size("260px")
                       .MinSize("260px")
                       .MaxSize("260px")
                       .Collapsible(true)
                       .Content(@<div style="height: 630px; background-color: #EDF8FE;">
               @using (Html.BeginForm("SearchDocument", "DocGroup", FormMethod.Post, new { id = "frmSearch" }))
                                     {
                                         <input type="text" name="name" value=" " style="display: none;" />
                                         <div class="wrapper">
                                                 <fieldset id="Price">
                                                     <legend>مبلغ سند</legend>
                                                     <div class="rigth">
                                                     </div>
                                                     <div class="left">
                                                         <div>
                                                             @Html.Label("از")
                                                             @Html.TextBoxFor(m => m.MinPrice, new { @class = "text" })
                                                         </div>
                                                         <div>
                                                             @Html.Label("تا")
                                                             @Html.TextBoxFor(m => m.MaxPrice, new { @class = "text" })
                                                         </div>
                                                     </div>
                                                 </fieldset>
    <input type="submit" name="name" value="اعمال فیلتر" id="btnFilter" class="button" />
}
                                 </div>);
               })
              )


and  jquery:

  $(function () {
        $("#btnFilter").click(function (e) {
            e.preventDefault();
   debugger;
            var form = $("#frmSearch");
            var condition = form.serialize();
           
            $.ajax({
                url: "/DocGroup/SearchDocumentGrid",
                data: JSON.stringify(condition),
                contentType: 'application/json; charset=utf-8',
                success: function (data) {
                    alert("success");
                }
            });
        });
    });

form.serialize retern ""
this code out of splitter works right and form.serialize work. why ?
Tags
Splitter
Asked by
mina
Top achievements
Rank 1
Share this question
or