Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3279106
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:33:19+00:00 2026-05-17T19:33:19+00:00

Is it possible to block a page when a user clicks on a link

  • 0

Is it possible to block a page when a user clicks on a link and only enable it once the response has come back from the server.
I had a problem recently where a link was clicked on a page several times resulting in two simultaneous changes.

The problem was that the page was allowing multiple submit. I have already resolved this on the server side using Struts saveToken() and isValidToken() to prevent this to happen again. This will ensure that if multiple submits are recieved the second one is not processed.

Now the problem i am having is if the user clicks on the submit link twice, the first request is valid but the second is not. The user is redirected to an error page not realising that the first request did go through.

I think the solution is to block/disable the link when it is clicked. I know you can use javascript to disable the link but i would like to use one of the AJAXy modal dialog boxes that i’ve seen on several sites. Basicly when you click on the link, a pop dialog shows up with a message “Please wait..”. The background is faded out and the user cannot do anything until the response has come back from the server. Most of the examples that i see seem to be Ajax based. My page does not use Ajax.

What is the easiest way to achieve this modal dialog box? I have been looking around and there are several plugins available for JQuery but given that i am new to it i dont quite understand it. Can someone show me an example of how to do this using Jquery?

Thanks

EDIT

Take this for example,

            //CONTROLLING EVENTS IN jQuery
            $(document).ready(function(){

                //LOADING POPUP
                //Click the button event!
                $("#button").click(function(){
                    //centering with css
                    centerPopup();
                    //load popup
                    loadPopup();
                });

                //CLOSING POPUP
                //Click the x event!
                $("#popupContactClose").click(function(){
                    disablePopup();
                });
                //Click out event!
                $("#backgroundPopup").click(function(){
                    disablePopup();
                });
                //Press Escape event!
                $(document).keypress(function(e){
                    if(e.keyCode==27 && popupStatus==1){
                        disablePopup();
                    }
                });

            });

I would like these events to be triggered when i click on a link. The link itself points to another javascript function. i.e.

<a href="javascript:submitform();">confirm</a>

How can i call the jquery bits inside of the submitform() javascript function? Preferabley after the submitform() has completed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T19:33:20+00:00Added an answer on May 17, 2026 at 7:33 pm

    Have a look at jQuery.dialog (website), it allows you to either show in-page divs as modals or alternatively even get your content from another page.

    <div id="progress" class="dialogContent" style="text-align: left; display: none;">
    <img src="../../global/style/default/images/ajax-loader.gif" style="margin-right: 5px;" />
    <asp:literal id="literalPleaseWait" runat="server" text="Please wait..." />
    </div>
    

    and then call the function below to show the dialog

     function ShowProgressAnimation() {
        var pleaseWaitDialog = $("#progress").dialog(
        {
        resizable: false,
        height: 'auto',
        width: 150,
        modal: true,
        closeText: '',
        bgiframe: true,
        closeOnEscape: false,
        open: function(type, data) {
        $(this).parent().appendTo($("form:first"));
        $('body').css('overflow', 'auto'); //IE scrollbar fix for long checklist templates
        }
        });
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is it possible to hide/block files/folders in a VS2008 solution from various users (by
I'm trying to block a script file from loading on user defined websites. To
I'm using C# with .NET 3.5. Is it possible to serialize a block of
Possible Duplicate: How do you send email from a Java app using Gmail? How
Is it possible to set the cursor to 'wait' on the entire html page
Is it possible to allow a user to select text in a silverlight text
It has been so long since I have coded a page in VB. For
I have a widget-like block of HTML+JavaScript that people can copy/paste into their HTML-page
I have about 20 div's in an aspx page. At any time, only one
Possible Duplicate: Why not use tables for layout in HTML? Under what conditions should

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.