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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:34:58+00:00 2026-05-26T12:34:58+00:00

I am working on a drupal site that has a form submit ajax call

  • 0

I am working on a drupal site that has a form submit ajax call to a function that triggers ceebox. Code for drupal php function is as follows:

    $commands = array();
    $html = '<a title="" style="display:none;" href="/subscribe" class="ceebox" id="subscribe" rel="iframe width:500 height:350"></a>';
//attempt to remove already existing ceebox generated elements
    $commands[] = ajax_command_replace('#subscribe','');
    $commands[] = ajax_command_replace('#cee_iframeContent', '');
    $commands[] = ajax_command_replace('#cee_title', '');
    $commands[] = ajax_command_append('body', $html);
    $commands[] = ajax_command_invoke(NULL, 'subscribeOpen', array('subscribe'));
    return array('#type' => 'ajax', '#commands'=>$commands);

Javascript that drupal function calls:

(function($) {
        $.fn.subscribeOpen = function(data) {

            $('#subscribe').ceebox().trigger('click');


        };



})(jQuery);

This all works as expected; ie brings up the ceebox containing /subscribe page content in an iframe. When I click close link on the ceebox or click the background to close, it shuts down first time. When I then click on the subscribe link to trigger the drupal ajax and ceebox call it adds an extra close link, an extra ‘Item 1 of 1’ title and an extra iFrame window. This repeats everytime I click close and then trigger the function add infinitum. I have tried to add unbind(‘#ceebox’) to the #subscribe element as well as various combinations of jQuery unique() methodto no avail. Could anyone shed light on how to unbind/remove these duplicate ceeboxes please?

  • 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-26T12:34:59+00:00Added an answer on May 26, 2026 at 12:34 pm

    I figured this out by taking a look through the jquery.ceebox.js file and found the intialise function to have a live() method running on it.

    This will cause all kinds of wonderful issues as it should only ever be called once on an element. The above code would call live() multiple times when triggering ceebox, therefore I would recommend that you replace line 374 of jquery.ceebox.js:

    $(elem).live("click", function(e){
    

    to read:

    $(elem).bind("click", function(e){
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a drupal 6 site at mydomain.com/drupalsite, and the designer has put
While working on an existing Drupal site I've noticed a strange glitch that causes
I am working on a Drupal 6 site that some CSS issues. I have
I'm working on a Drupal site/theme. The CSS and PHP modifications are fairly easy;
Working an a Drupal 6 site that I inherited, and I'm having a bit
Im working on a drupal site that uses jQtouch (for iphone), and im trying
I'm working on a Drupal mobile site which is powered by the Mobile module.
I'm working on a Drupal 5.x book-selling site and using the Views Fast Search
We're building a very content rich site in Drupal. It's my first time working
I'm working at a company that uses Drupal 6 to host documentation for it's

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.