943,740 Members | Top Members by Rank

Ad:
Apr 23rd, 2009
0

How to disbale Close(X) button in title bar

Expand Post »
Please anyone provides code with examle to disable the Close (X) button in title bar. If user wants to click automatically a dialog box must appear with message 'This is disbale'...

Thanks
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ukbasak is offline Offline
8 posts
since Nov 2008
Apr 23rd, 2009
0

Re: How to disbale Close(X) button in title bar

Immediate thought

Malware
you cant close this page unless you buy something
your pc is infected send us money
You are not supposed to take control of the browser
Imagine if you could not close a web browser when you went to some site on the internet that was loading your computer full of viruses!

lookup

onclose
onunload

something like
javascript Syntax (Toggle Plain Text)
  1. <script language="JavaScript">
  2. <!--
  3. var legalExit=0;
  4. var lpx=10;
  5. function leave() {
  6. if(legalExit==0) {
  7. var dl=confirm('WARNING: Closing this window means bla bla bla.\n\nClick OK to remain.');
  8. if(dl) {
  9. if(window.screen){
  10. lpx=screen.width;lpx=lpx-225;
  11. }
  12. var op=window.open('filename','','width=170,height=185,location=no,status=no,directories=no,toolbar=no,menubar=no,scrollbars=yes,resizable=no,top=10,left=' + lpx);
  13. }
  14. }
  15. }
  16. function openWin(u,t,x,y,s) {
  17. var op=window.open(u,t,'width='+x+',height='+y+',location=no,status=yes,toolbar=no,directories=no,menubar=no,scrollbars='+s+',resizable=no');
  18. op.focus();
  19. }
  20. // -->
  21. </script>
code is untested, just thought process
Last edited by almostbob; Apr 23rd, 2009 at 10:51 am.
Reputation Points: 562
Solved Threads: 368
Posting Maven
almostbob is offline Offline
2,970 posts
since Jan 2009
Apr 24th, 2009
0

Re: How to disbale Close(X) button in title bar

Thanks almostbob...

But this does not help me much. My browser window will contain all features as menubar, addressbar, standard button all... but this browser should not allow the user to close on clicking close (X) button. at time time a pop up massage appears with 'User cannot click on this Close Button'. the user must select the logOut menu to sign out.

Please send the code if you have.

Thanks -- ukbasak
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ukbasak is offline Offline
8 posts
since Nov 2008
Apr 26th, 2009
0

Re: How to disbale Close(X) button in title bar

YOU CAN TRY WITH BELOW SCRIPT.
JUST PASTE THE BELOW SNIPPET WITHIN HEAD TAG:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. window.onbeforeunload = confirmExit;
  2. function confirmExit()
  3. {
  4. if (window.event.clientY < 0 && window.event.clientY < -80)
  5. {
  6. return 'You will be logged out.';
  7. // You can set return false here.
  8. }
  9. }
Reputation Points: 26
Solved Threads: 44
Posting Whiz in Training
mail2saion is offline Offline
247 posts
since Apr 2009
Apr 26th, 2009
0

Re: How to disbale Close(X) button in title bar

Perhaps look into sessions, no experience to offer but.,,
it
logs them out of the server after time of no activity
whether they click the bye-bye button or no
Reputation Points: 562
Solved Threads: 368
Posting Maven
almostbob is offline Offline
2,970 posts
since Jan 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: javascript openWindow() problem
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: Simple Javascript Graphics





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC