Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 17th, 2004, 03:16 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default Disable all controls on a pop-up window

Hello all,

   I was wondering if anyone knew how to disable the minimize and more importantly the close "X" buttons in the upper right hand corner of a pop-up window.

Thanks for the help,

Jim

Reply With Quote
  #2 (permalink)  
Old August 17th, 2004, 03:46 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

No, not possible. Consider the security ramifications if you could open a window that the client couldn't close.

Mozilla provides signed scripts for such functionality, but it's proprietary to the Gecko browser. Read my responses to this thread:
http://p2p.wrox.com/topic.asp?TOPIC_ID=16522

Alternatively you can use CSS and layering to simulate a popup window, the content can either be included directory in the document or called using an inline frame. The caveat is the layer cannot leave the window calling it and when the browser window is closed, the layer of course goes with it.

Regards,
Rich

--
[http://www.smilingsouls.net]
[http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail
Reply With Quote
  #3 (permalink)  
Old August 17th, 2004, 03:53 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Thanks, I didn't think I could.
Is it possible in code to stop the user in the OnUnlod event? Or does this go back to your security comment?

Reply With Quote
  #4 (permalink)  
Old August 17th, 2004, 03:56 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

BTW such functionality is generally referred to as a "chromeless" window, the chrome refers to the browser controls, window border, close, minimize, etc.

Regards,
Rich

--
[http://www.smilingsouls.net]
[http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail
Reply With Quote
  #5 (permalink)  
Old August 17th, 2004, 03:57 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Why do you need to prevent the user from closing the window?

Regards,
Rich

--
[http://www.smilingsouls.net]
[http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail
Reply With Quote
  #6 (permalink)  
Old August 17th, 2004, 04:02 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

if they close the window without submitting, it can cause data issuse in the DB. I can't make the window modal because they need to move between the pop-up and calling window

Reply With Quote
  #7 (permalink)  
Old August 17th, 2004, 04:13 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Have you tried submitting the form onunload? I don't know if that works. You can force a confirmation dialouge onunload.

If you have the possibility of a DB being effected, such as fields across multiple tables where each must have rows with corresponding ids, I would suggest that you create all of those rows up front, and then if the user closes a window before completing steps in the submission, you can write a script to resume at the same place when the user comes back by detecting what fields exist and contiain data. (Just guessing at the scenario of course) Thing is it's better to anticipate the user closing the window than trying to stop them from doing it, e.g. anything that can go wrong will!

HTH!

Regards,
Rich

--
[http://www.smilingsouls.net]
[http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail
Reply With Quote
  #8 (permalink)  
Old August 17th, 2004, 04:18 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

   I tried submitting on OnUnLoad however there would be no way for me to validate data, also, if they do hit Submit, there will be 2 rows in the table.
  I guess I just need to stress to the users to be sure to Submit. But you are correct, what ever can go wrong will.

Thanks for your help!!

Jim

Reply With Quote
  #9 (permalink)  
Old April 12th, 2007, 10:06 AM
Registered User
 
Join Date: Apr 2007
Location: , , Canada.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorta the same topic we need to disable all browser functions when opening a window. This is for a corporate app and security wise want the printing, save, cut, copy, alt, ctl. Fkeys essentually everything shut off. We are converting everything to a graphic file so no highlighting will work.

Consider this an IE project.

B
Reply With Quote
  #10 (permalink)  
Old April 12th, 2007, 10:24 AM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

You can disable to your heart's content, but keep in mind the user can go around all of that and get the content directly from the cache. This is even easier to do in IE. You can disable the cache too, but in that case the user can disable script and just access the content directly.

You can make it difficult, but it's not impossible to work around disabling those controls. Any content rights management in a browser that you hope to attain is an illusion and should be treated as such.

You also don't need to convert to a graphic to prevent selection.

Code:
window.onselectstart = function()
{
    window.event.returnValue = false;
};

Regards,
Rich

--
Author,
Beginning CSS: Cascading Style Sheets For Web Design, 2nd Edition
CSS Instant Results

http://www.catb.org/~esr/faqs/smart-questions.html
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Window refresh and window pop up in Java Script Aleksandra Javascript How-To 2 March 2nd, 2007 06:47 PM
Pop Window testsubject General .NET 1 July 2nd, 2006 01:29 PM
pop up window sankar VB How-To 0 July 29th, 2003 01:29 AM



All times are GMT -4. The time now is 10:02 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.