[jQuery] Clone with Select values copied

2009-02-18 Thread happs74
Hi, I had an issue with the clone() function in that it wasn't copying over select values. I've added this function to my page function cloneForm(id, withEvents) { var clone = $('#'+id).clone(withEvents); var selvals = []; $('#'+id+" select").each(function() { selvals.push($(this).va

[jQuery] Re: Newbie traversal question

2008-10-14 Thread happs74
dave.methvin wrote: > > >> ... is there a way to recursively roll out until you reach a parent >> that matches a given id? > > It sounds like you want .parents(selector), which looks for the > ancestor elements matching the selector. > > http://docs.jquery.com/Traversing/parents#expr > >

[jQuery] Newbie traversal question

2008-10-13 Thread happs74
I have a click event tied to an element and I need to access a grandparent element that is quite a few jumps away. I could count the jumps and hard code it but is there a way to recursively roll out until you reach a parent that matches a given id? Or do you manually have to do it? Cheers in ad