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

On Post, Modal Window redirects parent URL

3 Answers 650 Views
Window
This is a migrated thread and some comments may be shown as answers.
Jeremy
Top achievements
Rank 1
Jeremy asked on 15 Feb 2012, 08:10 PM

I have two pages.

The parent: /Main/Home.aspx

The child modal: /Main/MoveJob.aspx

The modal window is a simple form with a Submit button.  The parent opens modal window. When the modal window’s submit button is pressed, the browsers URL is incorrectly redirected to the modal window’s URL.

Parent’s Code is as follows:

     <!-- Define the HTML table, with rows, columns, and data -->
     <table class="jobsGrid">
      <thead>
          <tr>
              <th data-field="title">Job #</th>
              <th data-field="Type">Type of Project</th>
              <th data-field="Desc">Description</th>
              <th data-field="Brand">Brand</th>
              <th data-field="Milestone">Next Milestone</th>
              <th data-field="Location">Job Location</th>
              <th data-field="Sub">Submitter</th>
              <th data-field="move"></th>
          </tr>
      </thead>
      <tbody>
    
          <asp:Repeater ID="Repeater1" runat="server">
            <ItemTemplate>
            <tr>
              <td><%# Eval("JobID")%></td>
              <td><%# Eval("JobTypeName")%></td>
              <td><a href="#"><%# Eval("JobName")%></a></td>
              <td><%# Eval("BrandName")%></td>
              <td>coming soon</td>
              <td><%# Eval("LocationName")%></td>
              <td><%# Eval("SubmitterName")%></td>
              <td><a href="javaScript:;" data-url="../Main/MoveJob.aspx" title="Move Job" class="moveLink" data-id="<%# Eval("JobID")%>">Move</a></td>
            </tr>
            </ItemTemplate>
          </asp:Repeater>
      </tbody>
     </table>
 
        <div class="moveWindow">
        </div>
 
 
 
<script type="text/javascript">
    function refreshGrid() {
        //alert("I will try to refresh the grid");
        var grid = $(".jobsGrid").data("kendoGrid");
        grid.refresh();
    }
 
    //MOVE WINDOW
    $(document).ready(function () {
 
        $(".jobsGrid").kendoGrid();
 
        $(".moveLink").click(function () {
            var id = $(this).data("id");
            var href = $(this).data("url") + "?jobId=" + id;
            var title = $(this).attr("title");
            var myWin = $(".moveWindow");
 
            if (!myWin.data("kendoWindow")) {
                // window not yet initialized
                myWin.kendoWindow({
                    width: "auto",
                    height: "auto",
                    modal: true,
                    resizable: true,
                    title: title,
                    content: href
                });
            } else {
                // reopening window
                myWin.data("kendoWindow")
                .content("Loading...") // add loading message
                .center()
                .refresh(href) // request the URL via AJAX
                .open(); // open the window
 
            }
 
            return false;
        });
    });
 
 
 
 
</script>

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 16 Feb 2012, 08:56 AM
Hi,

I guess you have nested form elements. This is not supported by any browser and is the reason why the parent form gets posted.

Regards,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Jeremy
Top achievements
Rank 1
answered on 16 Feb 2012, 06:21 PM
Yes, but how do I accomplish my goal?

Can someone, ANYONE, please tell me how to make a modal window using Kendo UI Window:
  • that is loaded with ajax
  • that has a form on it
Has no one ever tried this with Kendo UI?  Is this such a strange scenario?


0
Jeremy
Top achievements
Rank 1
answered on 16 Feb 2012, 06:42 PM
Dimo answered my question here.  I thought I was experiencing multiple problems,  but it all was the same cause; using fully-formed .aspx pages within the same page, loaded via ajax.


Tags
Window
Asked by
Jeremy
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Jeremy
Top achievements
Rank 1
Share this question
or