Disable Page on submit

Posted on 2006-05-10
Last Modified: 2008-01-16
How would I (what is the code) disable an entire page when someone click a submit button.Then enable it again after it processes the data. (The page then reloads)

I've seen it where you show a progress icon rotating and grey out the page so you can see everything although you can't do anything untill the process finishes.

Can anyone show me how this is done?

Question by:JsonTerre1
    1 Comment
    LVL 6

    Accepted Solution

    You will have to use javascript to disable the form. It's easy enough. You just set the form's disabled property to true.

    function btnSubmit_onClick(){
       Form1.disabled = true;
       return true;

    You'll want to do the opposite on page load:
    function page_onLoad(){
       Form1.disabled = false;
       return true;

    As far as putting in a "progress icon," you will want to create an animated gif. Put it in the document using the image tags. Only you will want to position it and hide it using CSS. Make sure to give the image tag an id so that you can reference it, and just show it after you disable the form.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
    Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now