473,396 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to disable/enable an entire html page

1
I am trying to create a page that has a link or button that once you click it, a table or div will appear and all other parts of the page will be disabled except for the newly appeared table. An example of that is google.com/ig “Edit this tab” link. I have tried in vain to decipher Google’s code. If any of you know how to do it, please send me the code. I appreciate you help.
Sep 20 '07 #1
5 28817
epots9
1,351 Expert 1GB
the trick is done by changing the z-index of divs, good luck
Sep 20 '07 #2
acoder
16,027 Expert Mod 8TB
Create a div and make it 100% in height and width. I'm assuming you want to create some form of pseudo-modality in your application.
Sep 21 '07 #3
JamieHowarth0
533 Expert 512MB
I am trying to create a page that has a link or button that once you click it, a table or div will appear and all other parts of the page will be disabled except for the newly appeared table. An example of that is google.com/ig “Edit this tab” link. I have tried in vain to decipher Google’s code. If any of you know how to do it, please send me the code. I appreciate you help.
Hi zak,

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. <!--
  3. function disablePage() {
  4. document.getElementById('myFreezeDiv').style.width="100%";
  5. document.getElementById('myFreezeDiv').style.height="100%";
  6. document.getElementById('myFreezeDiv').style.visibility="visible";
  7. document.getElementById('myFreezeDiv').style.position="fixed";
  8. document.getElementById('myFreezeDiv').style.zIndex="99";
  9. document.getElementById('myFreezeDiv').style.top="0px";
  10. document.getElementById('myFreezeDiv').style.left="0px";
  11. for (i=0;i<document.forms[0].length;i++) {
  12.    document.forms[0].elements.[i].disabled="disabled";
  13. }
  14.  
  15. myLinks = document.getElementsByTagName("a");
  16. for (j=0;j<myLinks.length;j++) {
  17.    myLinks[j].href="";
  18. }
  19. //--></script>
  20.  
This code will:
  1. set the DIV to be overlayed above all other elements;
  2. set the DIV to be positioned to fill your browser screen;
  3. disable all form elements within your primary form on your page;
  4. disable all links on your page.
Hope it helps,

medicineworker
Sep 21 '07 #4
peroo
1
Hi!

You can "disable" the entire html page with this code:

Expand|Select|Wrap|Line Numbers
  1. var blurDiv = document.createElement("div");
  2. blurDiv.id = "blurDiv";
  3. blurDiv.style.cssText = "position:absolute; top:0; right:0; width:" + screen.width + "px; height:" + screen.height + "px; background-color: #000000; opacity:0.5; filter:alpha(opacity=50)";
  4.  
  5. document.getElementsByTagName("body")[0].appendChild(blurDiv);
and re-enable by remove the blurDiv element:

Expand|Select|Wrap|Line Numbers
  1. var blurDiv = document.getElementById("blurDiv");
  2. blurDiv.parentNode.removeChild(blurDiv);
Sep 12 '08 #5
Dean
1
I think you are trying to make this thing far too complicated. All I did was create three separate divs. One to hold a simple message telling the user to wait; One to hold all the fields of the page; and one to hold the buttons to submit or cancel. The 'wait' div has 'style="display:none". When a button is clicked (OnClientClick="return ShowWaitDiv('cancel');" and OnClientClick="return Validate('save');") the show function simple sets the divs:

function ShowWaitDiv(saveorcancel) {
var div = document.getElementById(divWait.id);
div.style.display = "block";
var div1 = document.getElementById(divMain.id);
div1.style.display = "none";
var div2 = document.getElementById(divBut.id);
div2.style.display = "none";
if (saveorcancel == 'save') {
document.getElementById('<%= lblSaveorCancel.ClientID %>').innerHTML = 'Saving data, please wait...';
}
else {
document.getElementById('<%= lblSaveorCancel.ClientID %>').innerHTML = 'Redirecting, please wait...';
}
return true;
}

Simple solution and very easy to implement.
Jul 11 '11 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: JN | last post by:
I would like to disable all links and buttons on HTML page to prevent multiple clicking while page is not yet sent to server. I tried to disable whole document, but this won't prevent links to be...
4
by: Alex | last post by:
Hi. I need to insert an entire html page from a string variable into a asp.net page. I thought that literals should work, but still I need to remove some tags like html, body, etc. Thanks, ...
7
by: Michael | last post by:
I'm exploring how to programmatically disable/enable devices in a system using C#. -MH
3
by: Pietro | last post by:
Hi all, First of all I'd like to thank you very very much ,as finally after many years of searching,I could find a code to disable/enable the shift key,but actually i cannot use the code as I'm...
0
by: Alexander Vasilevsky | last post by:
Can to disable/enable smoothing font in the WPF? http://www.alvas.net - Audio tools for C# and VB.Net developers
27
by: Steve | last post by:
My apologies if this is a duplicate post, I can't find the earlier version of my question. I have a DIV that uses a CSS class defined at the thtop of an HTML page. The height and width of the...
4
by: fjm | last post by:
Hello eveyone Is there a way to email an entire html page after the page is processed for data? What I have is an entire html page that draws data from a db. I would like to email that form...
10
by: viki1967 | last post by:
Disable/enable icon.gif Hi all. I have this form in the page.htm: <form action="form.asp" method="post" onsubmit="return(validateForm(this));"> <select size="1" name="t_im"...
1
AR Ratheesh
by: AR Ratheesh | last post by:
Hi, Please help me to disable / enable task manager and Explore for a internet Cafe management project. Thanks in advance..
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.