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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:16:43+00:00 2026-05-28T20:16:43+00:00

This jquery_modal_confirm_dialogue is working after many experiments. When our visitors agree to our Terms

  • 0

This jquery_modal_confirm_dialogue is working after many experiments.
When our visitors agree to our Terms of Use, they are redirected to the product page products.html

I desperately need to set a cookie.
– if they do not agree, when they attempt to visit products.html, this
is not visible and displays the modal dialogue again

Could you please give me a hint?
(jquery 1.3.2.min.js)

This is my jqmodal.js

function confirm(msg,callback) {
  $('#confirm')
    .jqmShow()
    .find('p.jqmConfirmMsg')
      .html(msg)
    .end()
    .find(':submit:visible')
      .click(function(){
        if(this.value == 'yes')
          (typeof callback == 'string') ?
            window.location.href = callback :
            callback();
        $('#confirm').jqmHide();
      });
}


$().ready(function() {
  $('#confirm').jqm({overlay: 88, modal: true, trigger: false});

  // trigger a confirm whenever links of class alert are pressed.
  $('a.confirm').click(function() { 
    confirm('About to visit: '+this.href+' !',this.href); 
    return false;
  });
});// JavaScript Document

This is my index.html:

 <a href="http://products.html/" class="confirm">Products</a> 

    <div class="jqmConfirm" id="confirm">

    <div id="ex3b" class="jqmConfirmWindow">
        <div class="jqmConfirmTitle clearfix">
            <h1>Terms of Use</h1>
        </div>

        <div class="jqmConfirmContent">
        <p class="jqmConfirmMsg"></p>
            <p>Important legal information</p></div>

        <input type="submit" value="Decline" />
        <input type="submit" value="Proceed" />
        </div>
    </div>
  • 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-28T20:16:45+00:00Added an answer on May 28, 2026 at 8:16 pm

    It works, finally! I was missing the callback when the cookie exists and these tics ” around the value of the cookie. Here is how it looks like. Please, let me know if there is some obvious mistake. (many thanks for your support)

    function confirm(msg,callback) {
      $('#confirm')
        .jqmShow()
        .find('p.jqmConfirmMsg')
          .html(msg)
        .end()
        .find(':submit:visible')
          .click(function(){
            if(this.value == 'Proceed'){
               $.cookie("agreed_to_terms", '1', { expires : 1, path: '/' }); //set cookie, expires in 365 days
               (typeof callback == 'string') ?
                window.location.href = callback :
                callback();
            }
            $('#confirm').jqmHide();
          });
    }
    
    
    $().ready(function() {
      $('#confirm').jqm({overlay: 88, modal: 'true', trigger: false});
    
      // trigger a confirm whenever links of class alert are pressed.
      $('a.confirm').click(function() { 
        if ($.cookie('agreed_to_terms') == '1'){window.location.href = callback =
                callback()
           //they already have cookie set
        }else{
           confirm('About to visit: '+this.href+' !',this.href); 
        }
        return false;
      });
    });// JavaScript Document
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got this php page where I do a search which returns data from
I need to warn users about unsaved changes before they leave a page (a
How can I remove the animation from this jQuery modal window? You can see
This Jquery problem has been bugging me for a while now. I developed a
Using this jquery code: <a href=javascript:void(0) id=m1>Get Selected id's</a> jQuery(#m1).click( function() { var s;
I have this jQuery code that queries an API on a keyup event (via
I have this jQuery which works fine $(li[id^='shop_id']).click( function () { alert(I clicked on
I am using this JQuery Ajax Voting system guide as a rough reference but
I'm using this: jQuery('.class1 a').click( function() { if ($(.class2).is(:hidden)) { $(.class2).slideDown(slow); } else {
I have this jQuery: $(document).ready(function() { $(#panel).hide(); $('.login').toggle( function() { $('#panel').animate({ height: 150, padding:20px

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.