MrM
MrM

Reputation: 22009

How do I disable a page after a submit?

I am looking for a way to prevent multiple submits on a page. I have a table that is displayed on a submit or href click in jquery. How do I have everything behind the table grey opacity and disabled?

<head>...</head>
<body>
    <input class="reloadPage" type="button"/>
    ...
    <div id="divLoad" style="display:none;">
        <table id="tblLoading">...</table>
    </div>
</body>

$(document).ready(function () {
$(".reloadPage").click(function () {
    $("#divLoad").show();
    //grey backdrop and disable page
    ....
});
});

Upvotes: 1

Views: 2326

Answers (4)

MrM
MrM

Reputation: 22009

I used the filter:alpha(opacity = 0); opacity:0.0; style.

Upvotes: 0

Craigt
Craigt

Reputation: 3580

To do it manually you could try the following.

Add this style

#block
{
   background-color:#000;
   opacity:0.5;
   position:absolute;
   width:100%;
   height:100%;
   top:0px;
} 

Then this code should black out the screen.

$("body").append("<div id='block'></div>");

To remove it call:

$("#block").remove();

Upvotes: 1

alexl
alexl

Reputation: 6851

or simplemodal: http://www.ericmmartin.com/projects/simplemodal/

Upvotes: 1

Haim Evgi
Haim Evgi

Reputation: 125644

you can use jquery block ui plugin

Upvotes: 2

Related Questions