admin管理员组

文章数量:1398684

I was able to find one solution regarding modal windows, here is the link: Simple jQuery Modal Window Examples. However, what I want specifically is:

  • I want to open b.jsp as a Simple Window Modal, like the one given in that website link above.
  • After clicking the submit button I want b.jsp to open in that manner.

I tried several solutions, but I can't get it to work the same way.

Here is my code below:

a.jsp

<form action="b.jsp">
<input type="submit" value"click here to open modal window"/>
</form>

I was able to find one solution regarding modal windows, here is the link: Simple jQuery Modal Window Examples. However, what I want specifically is:

  • I want to open b.jsp as a Simple Window Modal, like the one given in that website link above.
  • After clicking the submit button I want b.jsp to open in that manner.

I tried several solutions, but I can't get it to work the same way.

Here is my code below:

a.jsp

<form action="b.jsp">
<input type="submit" value"click here to open modal window"/>
</form>
Share Improve this question edited Oct 25, 2013 at 21:41 James-Jesse Drinkard 15.7k16 gold badges118 silver badges140 bronze badges asked Feb 29, 2012 at 12:40 TomTom 7717 gold badges22 silver badges42 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 3

Using JQuery UI is very easy.

I do some changes:

Change type to button because you don´t nee sudmit form for load html.

<div id="resultreturn" style="display: none"></div>
<form >
<input type="button" value="click here to open modal window" id="loader"/>
</form>

Later I bind a event click an in this event:

$(document).ready(function(){
    $("#loader").click(function(){
                // Load the page into the div
        $("#resultreturn").load("b.html");
                // Show the modal dialog
        $("#resultreturn").dialog({ modal: true });
    });
});

I hope this help you

本文标签: javascriptopen a modal window in jspStack Overflow