0

Here Iam creating two dialog boxes on the click on links.When Dialog box no. 1 is open and I press escape key then it gets closed but this is not the case with dialog box no. 2.Why so?

<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>

<a href="#" id="PopUpLink">Open Popup</a>
<br><br><br>
<input type="button" value="Click me" id="Click_me">
<div name="Pop" title="Popup" id="Popup1"><a href="#" id="PopUpLink2">Hello,This is my first dialog box</a></div>

<div name="Pop" title="Popup" id="Popup2"><a href="#" id="PopUpLink3">Hello,This is my second dialog box</a></div>



$(function() {


      $("#Popup1").dialog({
          autoOpen:false,
          modal:true,
          title:"Pop Up 1",
          show:"drop"

      });

          $("#Popup2").dialog({
          autoOpen:false,
          modal:false,
          hide:"explode",
          title:"Pop Up 2",
          open:function(){
          $("#Popup1").dialog("close")}

      });


      $("#PopUpLink").click(function(){
        $("#Popup1").dialog("open")          
      });

    $("#PopUpLink2").click(function(){
        $("#Popup2").dialog("open")          
      });

      $("#PopUpLink3").click(function(){
        $("#Popup1").dialog("open") 
        $("#Popup2").dialog("close") 
      });

  });

Edited by pritaeas: Changed to regular thread.

3
Contributors
2
Replies
27
Views
4 Years
Discussion Span
Last Post by topdude155
0

I believe this is because the dialog doesn't have focus. You will need to find a way to give the dialog focus.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.