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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:44:20+00:00 2026-05-18T09:44:20+00:00

I realize this question has been asked several times in several different forms ,

  • 0

I realize this question has been asked several times in several different forms, but I cannot get it to work properly for the life of me.

I have two DIVs on my page used for modals, ids signup-popup and login-popup. They each have their own close buttons with class simplemodal-close and showing/closing each one on its own works fine.

I want to add a button to the signup modal that closes it and opens the login modal. I followed the instructions Eric gave in the first link above, which I’ve included below:

$('a#ask').click(function(){
    $('#modal-contact').modal({onShow: function (dialog) {
        // handle the close yourself.
        // Don't use the closeClass on this element
        // call $.modal.close(); when you are done
        // call a function to open a new modal
    });
    return false;
});

However, this doesn’t work; the signup modal closes but the login modal doesn’t. Here is my code (using noConflict, hence the use of jQuery() rather than $()):

jQuery(function (jQuery) {
    jQuery('#btn-signup-open').click(function () {
        jQuery('#signup-popup').modal({onShow: function (dialog) {
            jQuery('#login-from-signup').click(function () {
                jQuery.modal.close();
                jQuery('#login-popup').modal();
            })
        }});
        return false;
    });
});

And I also tried the following instead, figuring it was simpler and more straightforward, however the result was the same (signup modal closes, login modal doesn’t close, regular close button & form submit works fine):

jQuery(function (jQuery) {
    jQuery('#login-from-signup').click(function () {
        jQuery.modal.close();
        jQuery('#login-popup').modal();
        return false;
    });
});

I did try Eric’s other suggestion which was to just replace the content of the modal. This works, but seems hack-y because I have to manually bind the close button (not a big deal) and the modal doesn’t auto-resize for the smaller login form. While this works, it seems like there should be a better way to do it (specifically the code I have right above, or some minor tweak to it).

jQuery(function (jQuery) {
    jQuery('#login-from-signup').click(function () {
        jQuery('.simplemodal-wrap').html('<div class="popup simplemodal-data" id="login-popup" style="display: block;">'+jQuery("#login-popup").html()+'</div>');
        jQuery('.simplemodal-close').click(function() {jQuery.modal.close(); return false;});
          return false;
    });
});
  • 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-18T09:44:21+00:00Added an answer on May 18, 2026 at 9:44 am

    Thanks to Andrey for answering this in another post!

    The current onClose event acts like onBeforeClose and no onAfterClose for $.modal.close() is designed. The only workaround is to wait:

    $.modal.close(); window.setTimeout(showSecondModal, 500);
    

    Here’s my working code:

    jQuery(function (jQuery) {
      jQuery('#login-from-signup').click(function () {
        jQuery.modal.close();
        window.setTimeout(function() {jQuery('#login-popup').modal()}, 250);
        return false;
      });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I realize that this question is impossible to answer absolutely, but I'm only after
I realize this perhaps a naive question but still I cant figure out how
I realize there's no definitely right answer to this question, but when people talk
Ok so I realize that this is a pretty vague question, but bear with
I realize that the query this question is looking for won't be enough to
I'm writing this question from the standpoint of an ASP.NET application. However I realize
I realise that this is a very basic question, but it is one which
I realize this would violate convention, but I'm curious to know if you can
After posting this question and reading that one I realized that it is very
(Note: I realize this is close to How do you document your database structure?

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.