jQuery BlockUI

One of my favorite jQuery plugins is the ‘BlockUI’.   I’ve been using this with my ASP.NET MVC applications.

I mostly use BlockUI as a way to prevent double submitting an entry on a form.   Since I’m using jQuery form validation as well, a typical ‘validate’ before submit looks like this:

"Before BlockUI":
$(function(){
    $("#AdjustmentAmount").maskMoney();
    $("#addCompanyDirectDepositFrm").validate().form();
})
 
"After BlockUI":
$(function(){
    $("#AdjustmentAmount").maskMoney();
    $("#addCompanyDirectDepositFrm").validate({
        submitHandler: function(form) {
            $.blockUI({ message: "Adding Direct Deposit...Please Wait<br/>" });
               form.submit();
              }
    }).form();
})
 

As you can see, it’s quite easy to implement.  I also use this on some redirects as well as Ajax calls.

Learn more about BlockUI here

(information on the validation library as well can be found here)

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s