3

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>
James Drinkard
  • 15,342
  • 16
  • 114
  • 137
Tom
  • 761
  • 7
  • 22
  • 41

1 Answers1

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