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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:26:24+00:00 2026-06-13T06:26:24+00:00

Hey so i have this code : $(‘#album_cell’ + currentCell).toggle( function() { $(‘#album_cell’+currentCell).flip({ direction:

  • 0

Hey so i have this code :

$('#album_cell' + currentCell).toggle(
    function() {
        $('#album_cell'+currentCell).flip({
            direction:  'lr',
            color:      "#FFF",
            content:    '<?php echo form_open('subjects/insert_caption');?>'
                      + '<textarea id="caption_input' + currentCell + '">'
                      + '   <?php echo $this->lang->line('insert_catpion_text'); ?>'
                      + '</textarea>'
                      + '<input type="submit" id="submit_caption' + currentCell + '" value="<?php echo $this->lang->line('save'); ?>" /> '
                      + '<?php echo form_close(); ?>'
                      + ''
        });
    },
    function() {
        $('#album_cell'+currentCell).revertFlip();
    }
);

I’m using CodeIgniter & jQuery Flip plugin, which is unrelated but explains the unknown code to some of you.

Now all of the data is correct and the plugin creates some content after the first click and reverets to the original as expected.

Now my question is how can i bind an event on the created content so a click on the inner textarea/button dosen’t fire the toggle method?

EDIT:

As requested, this is the outputed HTML:

<form action="http://localhost/ci/index.php/subjects/insert_caption" method="post" accept-charset="utf-8">
    <textarea id="caption_input1">add</textarea>
    <input type="submit" id="submit_caption1" value="save">
</form>

I’ve tried :

                    $('#album_cell'+currentCell).on(
'click','#caption_input'+currentCell,function() {
                     alert();
                     e.stopPropagation();
                    });

But that didn’t work, it does fire the event but still toggles.

  • 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-13T06:26:25+00:00Added an answer on June 13, 2026 at 6:26 am

    You must add a selector to your .on() function to bind event to the dynamic created elements.

    Try something like (where body is too permisive, use your the container of your loaded data):

    $('body').on('click','#caption_input'+currentCell,function(e) {
        e.stopPropagation();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey so I have this code: var channel = pusher.subscribe('test_channel'); channel.bind('my_event', function(data) { alert(data);
I have this JavaScript code: var r = { a1:function() { alert('hey!'); }, a2:this.a1
Hey all i have this code here: ScriptManager.RegisterClientScriptBlock(Me.Page, GetType(String), showNotifier, ;$(function() {showNotifier(3000,'#cf5050',' & msg
Hey guys, I have this piece of jquery code: <script type=text/javascript > $(function() {
Hey guys, I have this code within a function inside a class that is
Hey I have this code right here: http://pastie.org/534470 And on line 109 I get
Hey I have this code but it doesn't work because it is expecting a
Hey all, this is the code i have to check for a day thats
Hey, I don't have any code because I don't know how to do this.
Hey guys I simply cannot get this to work. I have some content that

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.