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 9064203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:11:23+00:00 2026-06-16T16:11:23+00:00

I wasn’t sure the best title for this one… Live Link Provided Here My

  • 0

I wasn’t sure the best title for this one…

Live Link Provided Here

My overall goal for this project. There are certain documents that require an email be required to download them. Through asp.net I am binding a repeater and then with jquery removing the href and placing it in the rel tag until they add their email address.

$('a[data-email="True"]').each(function () {
    var href = $(this).attr('href');
    $(this).attr('href', '#_');
    $(this).attr('rel', href);
});

The jquery checks to see if the data-email tag = “True” if it is then the bootstrap modal will pop up and via ajax the form calls a web method and adds the email to the database if it isn’t a duplicate.

$('.emailcheck').live("click", function (e) {        
    if ($(this).data("email") == "True") {
        $('#emailModal').modal();
    }
});

Upon success the modal will close and on each data-email="True" the link is added back to the href and the data-email is set to False

$('#emailModal').modal('hide');
$('body a[data-email="True"]').each(function () {
    var reltag = $(this).attr('rel');
    $(this).attr('href', reltag);
    $(this).attr('data-email', 'False');
});

All of this happens successfully, and the email downloads upon another click. However, when I click the download link the modal still pops up.

Can someone please guide me to a solution as to why the modal is still popping up. Also in the success script is there a way to automatically trigger the download?

  • 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-06-16T16:11:25+00:00Added an answer on June 16, 2026 at 4:11 pm

    Try this – not much of a change but here’s a jsFiddle showing it should work

    OnLoad Function

    $('.emailcheck').each(function() {
        var href = $(this).attr('href');
        $(this).attr('href', '#_').attr('rel', href);
    });
    

    Click Event

    $(document).on("click", '.emailcheck', function(e) {
        e.preventDefault()
        if ($(this).attr("data-email") == "True") {
            $('#emailModal').modal();
        }
    });
    

    Email Submit Function

    $('#emailModal').modal('hide');
    $('.emailcheck').each(function() {
        var reltag = $(this).attr('rel');
        $(this).attr('href', reltag).attr('data-email', 'False');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wasn't sure what to title this question. Here's my goal: On page one,
Wasn't too sure exactly how to title this question, but here's the issue that
I wasn't sure how to phrase this so the title is a bit cryptic.
I wasn't sure what the best title is so if anyone has a better
Wasn't sure how to write a good title for this question... :) I'm new
I wasn't even sure how to title this right. I have a page that
I wasn't sure how to word the title to this well, apologies if the
wasn't sure whether to put this in Software or here, so I figured I'd
I wasn't sure what to put into the title for this...please read on... I
I wasn't sure what the best way to word this question is but basically

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.