Hey, Here's an outline of what I'm trying to accomplish:

1) Clone one div into another...maintaining events (works)
2) Append that html into a div (works)
3) Run a search and replace on the new contents (works)
4) Keep the events (doesn't work)

Here's the code i'm using:

            $('.codex-relational-anchor').bind('click',function(){

                //If the button is clicked for the first time, clear
the divs contents
                if(iter == 0)
                    $('.codex-relational-
form').slideUp('fast').empty();

                //Clone the contents of .manytomany-hidden along with
their events into .codex-relational-form
                $('.manytomany-hidden .relational-form-
extra').clone(true).appendTo(".codex-relational-
form").parent().slideDown('fast');


                var html = $('.codex-relational-form').html();
                html = html.replace(/\{num\}/g,iter);
                $('.codex-relational-form').html(html);
                iter++;

                return false;
            });

If I comment out the string replacements, then the events remain.

Reply via email to