Hi bearstate,

try using the cloneNode method:

reference: http://www.javascriptkit.com/domref/elementmethods.shtml

cloneNode(deepBoolean):

Duplicates and returns a copy of the current node as a standalone node
(not part of document tree). Cloning a node copies both the original's
attributes and values, including the ID attribute, so be sure to alter
the cloned ID attribute's value so it's unique before introducing it
to the document tree. This method supports a single Boolean parameter,
"deepBoolean" that when set to true, clones all the sub nodes of the
current node as well, such as any text contained within.


Example(s):

p=document.getElementById("mypara")
pclone = p.cloneNode(true)


And then change Ids, and reinject result in the DOM.

--
david

On 23 fév, 09:22, BearState <wixelb...@yahoo.com> wrote:
> OK,  I'm still new to prototype and scriptaculous and I don't like to
> ask, but I guess having the flu, I'm feeling kicked around enough to
> do so.
>
> And it appears to be a tough one anyhow.
>
> You have an unordered list which you have made sortable.  It allows
> the item in the list to be edited and save back to the database.
>
> It also is intended to allow ...
>
> 1) deleting the item from the list.
> 2) inserting a new item in the list.
>
> and
>
> 3)  cloning the item in the list.
>
> So if I identify my <li>  </li>  by its id   as  $(id),  how do I get
> a clone of this object with everything in between, make some
> modifications to ids in its content so it is unique and write the
> nasty critter back into the list?
>
> God, I hate the flu.  Why you made us humans suffer the flu and have
> to defecate, I will never appreciate.  Er ... uh, God,  don't be
> offended.  That's just my take on it.  Amen.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to