This topic is locked

Disable Close Button Popup

5/15/2020 4:25:16 PM
PHPRunner General questions
C
copper21 author

Hello all,
Looking to see if there is a way to prevent someone from clicking the small "x" on the upper right side to close a popup window. I am using the following code to open a popup window:
window.popup = Runner.displayPopup( {

url: "message_acknowlegements_add.php",

width: 700,

height: 480,

header: 'Message from Administrator'
All works great. I am wondering if there is a way to prevent someone from clicking the small "x" to just close the popup...the user has to click the save button to add a record. Once the user clicks save, I have the window closing and refreshing the menu page from which the popup comes up.
In the manual, I believe there is an option to not use a close button, but I don't think this applies to the small "x" on the upper right hand corner.
Thank you in advance.
Brian

Admin 5/15/2020

I don't have an exact solution for this but I think this icon can be closed with the help of some CSS (display: none) or some Javascript.

C
cristi 5/16/2020

css:

button.close {display: none !important;}
C
copper21 author 5/18/2020



css:

button.close {display: none !important;}



That worked great, thank you. I added that CSS to the editor page. It seems that it took the "x" away from every popup in the project. Is there a way to have it just for that add page?
Thank you again!

W
WilliamBDevClub member 5/18/2020



That worked great, thank you. I added that CSS to the editor page. It seems that it took the "x" away from every popup in the project. Is there a way to have it just for that add page?
Thank you again!


Hello Brian21,
I used this to hide buttons on the popup. Maybe it can search for the other small x. Change values as needed as this is right out of one of my projects.



var win = Runner.displayPopup( {

url: "tClient_edit.php?editid1="+proxy.values["ClientID"],

width: 1100,

height: 700,

header: 'Client Settings',

footer: '<a href="#" onclick="window.win.close();">Close window</a>',

afterCreate: function(win) {

window.win = win;

$('iframe').contents().find("button#backButton1").hide();

$('iframe').contents().find("a#viewPageButton1").hide();

},

beforeClose: function(win) {

window.parent.location.reload();

return true;

}

})