homepage Welcome to WebmasterWorld Guest from 54.163.84.199
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Cloned objects and functionality
a JQuery query
Scally_Ally




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

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

 

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved