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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:52:31+00:00 2026-06-08T06:52:31+00:00

I have some code which uses jquery to load the search results onto the

  • 0

I have some code which uses jquery to load the search results onto the same page. It works fine when run on a standalone page. The same code fails half-way through when loaded inside a colorbox window. How can I fix this?

Here is the code which works fine on a standalone page but fails in a colorbox window.

<script>
  $('button.trigger').on('click', function(){
    $mybtn = $(this);
    $mybtn.text('Searching...').addClass('disabled');
    $.post(
      '/results/people?layout="no"',
      $('#find_or_add_person').serialize(),
      function(data){
        $('#response').html(data);
        $mybtn.text('Search').removeClass('disabled').removeClass('btn-primary');
      }
    );
    return false; 
  });
</script>

Note: it fails after setting the button text to “searching” and disabling the button.

Here is the code which calls the colorbox.

<script>
    $('a.add').colorbox({
          width:440,
            height:400,
            onComplete: function(){
                    $('#colorbox').css('display', 'block');
              }
    });
</script>
  • 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-08T06:52:32+00:00Added an answer on June 8, 2026 at 6:52 am

    I found the answer–quite by accident. It turned out that odd HTML ordering of tags was the culprit.

    Specifically, in the HTML I loaded into the colorbox window I had opened a div tag and then opened the form tag and then closed the div tag before closing the form tag. For whatever reason, that strange behaviour on my part didn’t cause any problems when I was using the page as a standalone page. However it was messing up some of my capybara tests. In addressing the capybara problem, I fixed the tag ordering and viola! Immediately the page began to work in the colorbox window.

    I never would have guessed. Ultimately I don’t understand the underlying mechanism that caused this strange behaviour, but I’m glad it is resolved.

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

Sidebar

Related Questions

I have some code which uses a selector in a loop. This works: document.getElementById(new_grouping_+i).value
I have some code, which uses the ExecuteStmt method on the Axapta Object when
I have a user control which uses objects as inner properties (some code is
I have a page that uses jQuery's $.post() method to get some html and
I have an ASP.NET application which uses JQuery datepicker for picking dates in some
I have some code which uses recursion in its implementation. The profiler which I'm
I have this jQuery code, which uses the toggle() function on a checkbox input
I have a page, which uses jQuery Autocomplete on the second two textboxes (investigator
I have some code which takes strings representing hexadecimal numbers - hex colors, actually
I have some code which I want to document with in-body comments like so:

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.