views:

318

answers:

2

I need to kill the close 'x' button at the top of a jQuery UI modal dialog box. I have a modal that opens with an OK button that redirects to the site. The site behind the modal is in an iframe. When the user agrees to the statement in the dialog box and clicks the 'OK' button, it redirects to the site that is outside the iframe. If the user clicks on the 'x', it goes to the iframe site, which I do not want to have happen.

I need the modal to work as a one-way to the site it goes to. It basically forces the user to accept the user agreement.

I would post code, but its an intranet site.

Thanks everyone for your help!

EDIT: This site is a government intranet portal, not a commercial site. So the goal is NOT to trap a user into the site, but rather to let the user know that the use of this site is restricted and to make sure you understand and accept the user agreement or you cannot use the site.

+2  A: 

You can add an event on open to remove the close button.

Using firebug I found that the CSS class for the <a> element is ui-dialog-titlebar-close.

Jeremy
+4  A: 

Why not style it to not display at all? Add this line to stylesheet:

.ui-dialog-titlebar-close { display: none }
MBO
This works, but the hyperlink is still there. So if I mouse over the spot I can still click on it. If you go into the js and look for the hyperlink reference and delete it, it disappears completely. Thanks everyone for your help!
tahdhaze09