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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:59:29+00:00 2026-06-04T04:59:29+00:00

Could do with some help you guys. So I’m using jQuery colorbox and its

  • 0

Could do with some help you guys.

So I’m using jQuery colorbox and its activated by clicking a link. In the colorbox there is a form with some checkboxes, what I would like to do is to get all the values of the selected checkboxes into the parent when submit is clicked (and close colorbox subsequently). I don’t want the parent window to refresh. It should automatically populate the “Checkbox Items from Colorbox” with the contents

Here is the link http://tdesigns.net84.net/colorbox/example1/

Parent code

<!DOCTYPE html>
<html>
    <head>
        <meta charset='utf-8'/>
        <title>ColorBox Examples</title>
        <style>
            body{font:12px/1.2 Verdana, sans-serif; padding:0 10px;}
            a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;}
            h2{font-size:13px; margin:15px 0 0 0;}
        </style>
        <link rel="stylesheet" href="colorbox.css" />
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
        <script src="../colorbox/jquery.colorbox.js"></script>
        <script>
            $(document).ready(function(){
                $(".iframe").colorbox({iframe:true, width:"400px", height:"400px"});                
            });
        </script>
    </head>
    <body>
        <p><a class='iframe' href="../content/ajax.html">Outside Webpage (Iframe)</a></p>
        <p>
            Checkbox Items from Colorbox
        </p>
    </body>
</html>

popup code

<form action="" method="post">
    Choose a country 
    <br /><br />
    <input type="checkbox" name="countryCheckbox[]" value="UK" />UK<br />
    <input type="checkbox" name="countryCheckbox[]" value="USA" />USA<br />
    <input type="checkbox" name="countryCheckbox[]" value="Japan" />Japan<br />
    <input type="checkbox" name="countryCheckbox[]" value="China" />China<br />
    <input type="checkbox" name="countryCheckbox[]" value="Australia" />Australia
    <br /><br />
    <input type="submit" name="formSubmit" value="Submit" />
</form>

Would really appreciate it if I could get some help with this.

Many thanks in advance

  • 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-04T04:59:33+00:00Added an answer on June 4, 2026 at 4:59 am

    You can do this by adding the following function in your ajax.html file

    First load jQuery in that file and then add this document ready function

    $(document).ready(function(){
            $('#form').submit(function(){
    
                        $('input:checkbox:checked').each(function(){
                            window.parent.$("#text").text(parent.$("#text").text() + $(this).val()+" ,");
    
                        });
                        parent.$.colorbox.close();
                        return false;
            });             
        });
    

    What this is doing is when user clicks on the submit button on overlay iframe it takes all checked checkbox add those values into parent window’s text div and then close the colorbox window.

    Here’s the modified code for ajax.html file

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <form action="" method="post" id='form'>
        Choose a country 
        <br /><br />
        <input type="checkbox" name="countryCheckbox[]" value="UK" />UK<br />
        <input type="checkbox" name="countryCheckbox[]" value="USA" />USA<br />
        <input type="checkbox" name="countryCheckbox[]" value="Japan" />Japan<br />
        <input type="checkbox" name="countryCheckbox[]" value="China" />China<br />
        <input type="checkbox" name="countryCheckbox[]" value="Australia" />Australia
        <br /><br />
        <input type="submit" name="formSubmit" value="Submit" />
    </form>
    
    <script>
        $(document).ready(function(){
            $('#form').submit(function(){
    
                        $('input:checkbox:checked').each(function(){
                            window.parent.$("#text").text(parent.$("#text").text() + $(this).val()+" ,");
    
                        });
                        parent.$.colorbox.close();
                        return false;
            });             
        });
    </script>
    

    Also add an id to the paragraph where value will be added like this

    <p id="text">
        Checkbox Items from Colorbox: 
    </p>
    

    You have to run the code from localhost or same virtualhost if you have any or it will not allow accessing parent from child iframe. Just drop the modified files in a folder in your document root and access it through browser. Let me know if it works.

    here’s a working demo http://joynag.net/demos/colorbox/

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

Sidebar

Related Questions

Guys, I opened this question (I hope could help some others) but reading stackoverflow
Hey Guys I would very much appreciate some help with the following. We're using
I could use some help writing a regular expression. In my Django application, users
I could use some help creating an XSL template that will take a string
I could use some help with expression conversion. I have a method on a
i have an issue i could use some help with, i have python list
I'm new to SQL and could use some help in creating a database schema
I am getting the following error and could use some help resolving it. Anyone
We're having a small issue and could use some help - we have the
I have a piece of code here that i really could use some help

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.