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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:10:44+00:00 2026-05-26T11:10:44+00:00

I am using ColorBox inline functionality and I have created a button which I’ve

  • 0

I am using ColorBox inline functionality and I have created a button which I’ve set to close the window when clicked:

$('.closebutton').live('click', function(){
        $.fn.colorbox.close();
    });

I have another function which I want to run when the button is clicked, so I’ve used:

<button class="closebutton" onclick="myFunction();">Close</button>

Problem is the myFunction is not working above.

Any ideas please?

UPDATE:

Here is where the code is:

<script type="text/javascript">
jQuery(document).ready(function() {
    $(".inline").colorbox({inline:true, width:"50%"}); //for colorbox inline
    $('#cboxClose').remove(); //remove popup window close button

    $('.closebutton').live('click', function(){
        $.fn.colorbox.close();
        myFunction();
    });

Adding myFunction(); before or after $.fn.colorbox.close(); is not working

myFunction code: (This goes after the code above on the page)

<script type="text/javascript">
function myFunction() {
    $("#ajax-form").submit(function(){
        $.post("update.php",
        $("#ajax-form").serialize(),
            function(data){
                $('#jqm').attr('src', 
                $('#jqm').attr('src'));
            }
        );
        return false;
    });
}
</script>

UPDATE 2:

I’ll try to explain better: I have a form and input on the main page that works find, so when you add some text to the input box and submit then form then the value of the input is submitted.
Now, when I put that same input in the inline area of colorBox so that it appears inside the popup window the value is not submitted. I’ve tried grabbing JS errors on firebag but cannot see anything there.
Hope this helps.

  • 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-26T11:10:45+00:00Added an answer on May 26, 2026 at 11:10 am

    Why not just add myFunction() before $.fn.colorbox.close();? That way you can be sure what order things are handled in.

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

Sidebar

Related Questions

I am using colorbox a jquery plugin to emulate modal window which is not
I'm using jquery colorbox to popup user accounts in a window. I also have
I am using colorbox which I have used many times for different clients, but
I'm using the colorbox plugin for jQuery. I know I don't have to have
I'm using the jquery plugin ColorBox . I have a page with several item
I have an app that's using colorbox and various ajax requests. Sometimes, I'll have
Using colorbox: http://colorpowered.com/colorbox/ Im using this to open a window up using the iframe
I am using JQuery colorbox like that: There is a link(with a button) that
I am using the 'Colorbox' (http://colorpowered.com/colorbox/)jQuery plugin to display modal window. One of the
I'm using COLORBOX (http://colorpowered.com/colorbox/). I have two different colorboxes on the page and they

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.