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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:29:44+00:00 2026-06-10T15:29:44+00:00

I have a link on my page, which calls a login form inside Fancybox.

  • 0

I have a link on my page, which calls a login form inside Fancybox. Due to how scoping in the CMS “works”, this needs to be called from a different page.

My first idea was to call it with AJAX, but the problem then, was that the page would redirect to the login page on submit, which is not what I want. It should simply refresh the current page.

My second idea then, was to iframe the form in. It’s a bit more clumpsy, but seems to do the trick. Upon submit, it only refreshes the view in the iframe, instead of redirecting the user, which is one step forward

However, we still need to refresh the page, so that the content may be updated now that the user is logged in. I’ve tried binding a function to the .on(click) of the <submit>. I’ve also tried binding a function to onsubmit on the form itself. I even tried inlining it. Neither seem to do squat.

Should I give up and my dream of being a Javascript developer and fall back on a life of crime, or is there actually a real way to do what I’m trying to do?

I am using Fancybox v1.3 and jQuery v1.7.2.

$('a#myLoginTrigger').fancybox({
    type: 'iframe'      
});


$('form#myForm').on('submit', function(){
    alert('Sweet dude, I can run functions in here!');

    // I assume this will refresh the entire page, not just the iframe
    location.reload();

    // This has no effect whatsoever
    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-06-10T15:29:46+00:00Added an answer on June 10, 2026 at 3:29 pm

    This is what I ended up doing:

    $('a#loginTrigger').fancybox({
        type: 'ajax',
        href: '/Login.aspx #loginContainer'
    });
    
    $('body').on('submit', '#forLogin', function(e) {
        e.preventDefault();
    
        var url = $(this).attr('action');
    
        $.post(url, $(this).serialize(), function(data) {
            location.reload();
        })
    });
    

    First I use AJAX to load the form on the login page. Then, when the user submits the form, I cancel the default action, and AJAX-post it to the original page, and then reload the whole page.

    A strange bug I encountered, was that jQuery couldn’t figure out how to post it, if the action URL contains a question mark. To begin with, I tried posting to the page with /?ID=42 (the ID of my login page). The CMS can use both ID and the page title to navigate pages. Using the page title (login.aspx) worked fine.

    However, this bug was fixed after updating from jQuery 1.7.2 to 1.8.0. 🙂

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

Sidebar

Related Questions

This may sound a weird question, I have a page which has a link:
I have a link to a page which invokes the 'Sexy Alert Box' script
I have a page which when an a link is clicked (which must remain
I have an html page which has a link called open. Once the link
I have a page in which i have provided a link clicking on which
I have a master page which references a style in the following manner: <link
I have a simple link in a menu <a id=Home href=Amico-Bio-Home-Page></a> to which i
I have a link that calls this: <%=link_to 'Free Trial', '/sign_up', :rel => #signup,
I have a link in an update panel which calls a js method to
So I have a link on my page Add Shipping Point. This brings up

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.