2

I have created a popup window and below is my script.

         var action="generateCertificate";
         var url=contextPath +"/MyPage/MyPage.do?actionToPerform="+action;
         var myWindow=window.open(url,"","width=500,height=500");

And the script is successfully creating a popup window.

now my issue is when i click on the background of my page the popupbox is getting hided.

how to mask the background when popupbox is fired.

Plz help me.

Surya Prakash Tumma
  • 2,153
  • 4
  • 27
  • 47
  • Have you thought about using a dialog box with an iframe in it, such as with Bootstrap? – digitalextremist Jan 13 '14 at 08:39
  • You may want to check jQuery UI and its modal dialog: http://jqueryui.com/dialog/#modal-confirmation – RononDex Jan 13 '14 at 08:39
  • it is not possible using javascript? – Surya Prakash Tumma Jan 13 '14 at 08:49
  • @SuryaPrakashTumma jQuery **is** JavaScript, it's just making writing it much easier as other people already wrote it for you. For this purpose jQuery is very common choice, can't see any reason why not use it. Anyway, you might take a look [here](http://stackoverflow.com/questions/3630230/javascript-modal-popup), if you didn't already. – Shadow The GPT Wizard Jan 13 '14 at 11:23

2 Answers2

1

You can use jQuery BlockUI Plugin : BlockUI.

Shhade Slman
  • 263
  • 2
  • 10
1

No. There is no way to make a popup window modal. As the name itself suggests that it is a separate window.

If you want, you can use showModalDialog() in Javascript. The dialog allows you to include a jsp or html page inside

http://msdn.microsoft.com/en-us/library/ie/ms536759(v=vs.85).aspx

https://developer.mozilla.org/en-US/docs/Web/API/Window.showModalDialog

Also as suggested by others above, you can go for jQuery.

Keyur Golani
  • 573
  • 8
  • 26