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

  • SEARCH
  • Home
  • 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 469489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:47:16+00:00 2026-05-12T23:47:16+00:00

On pdf downlaod link need to open a jQuery dialog and have a form

  • 0

On pdf downlaod link need to open a jQuery dialog and have a form taking name, email and a confirmation checkbox.

There will be some validation on the fields eg. required min and max size etc…

Have initialised the dialog on page load and the dialog is opened on pdf download link.

$("#dialog").dialog({
    bgiframe: true,
    autoOpen: false,
    modal: true,
    buttons: {
        'Continue': function(){
            var valid = true;
            valid = valid && checkExists(name, 2, 50);
            //valid = valid && checkEmail(email);
            valid = valid && checkTrue(agree);

            if(valid) {
                //ajax call to controller
                return true;
            }
        },
        'Cancel': function(){
            $(this).dialog('close');
        }
    }   

});

$("a.download-document").click(function(){
    $("#dialog").dialog('open');
});

The problem I am having is that because I have no return false on the click event it will open the dialog but then continue with the click event.

How do I get the click event to only continue when the form is submitted and the validation OK?

  • 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-12T23:47:16+00:00Added an answer on May 12, 2026 at 11:47 pm

    One simply way is to always return false from the link click handler and then use window.open from the dialog’s callback handler to download the pdf.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to download all pdf files from a certain domain. There are about
I need to know if there is a way in java/servlet to make documents(doc,pdf)
I need to give a download link to a pdf file which is in
I have many pdf files in my project so I need it available to
I have a pdf and want to offer the user a simple Download link.
We have a need to convert MS Office documents to PDF real time when
I have a link to a PDF on my web page and I want
I have some data in a text area and there is a link 'create
I have a web page with a download link on it. Using jQuery I
I have a webservice I need to call via a link. The webservice returns

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.