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 have around 1000 pdf filesand I need to convert them to 300 dpi
I have a PDF file, which contains data that we need to import into
I have a pdf file.I need to find all the hyperlinks available in that
I need to know if there is a way in java/servlet to make documents(doc,pdf)
I have a pdf file on my server. I want to create such link
I am giving link of a pdf file on my web page for download,
Quick (and hopefully easy) question: I need to trigger a download of a PDF
I have 3 PDF documents that are generated on the fly by a legacy
The .NET coding standards PDF from SubMain that have started showing up in the
this code var tip = <p class='adobe-reader-download'>Most computers will open PDF documents automatically, but

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.