Welcome to WebmasterWorld Guest from 54.167.157.247

Forum Moderators: open

Message Too Old, No Replies

Cloned objects and functionality

a JQuery query

   
12:45 pm on Oct 30, 2008 (gmt 0)

5+ Year Member



Hello,
I have a little JQuery query wondering if anyone can shed any light on it.

I have a block of HTML that i clone in order to add users to a list. This block of HTML has a form in it and also a button - both of which has functionality that is defined using JQuery (for the submit and click). Problem is that as the HTML is cloned, and even though i have defined stuff after the clone the functionality is not picked up. Very strange.

This is IE specific - my code works fine in FF.

What i am thinking is that IE renders the code at a different time? i dont know. here is a snippet of the code in question.

$("#my_add_user_button").click(function(){

//set up a load of stuff here then get to the section where a user is cloned and prepended to the list

var userClone = $("#new_user_html").clone();

$(".exp_delete", userClone).click(function(){
defineDeleteFunctionality($(this))
});
$(".business_user_form", userClone).submit(function(){
businessUserSubmit( $(this) );
return false;
});
$("#users_total").prepend( $(userClone).html() );

});

Any help appreciated.
Thanks
Ally

 

Featured Threads

Hot Threads This Week

Hot Threads This Month