I want to drag from a list of elements (Buttons, TextBox) and drop clones into a “form designer” div. How can I get the original element’s attributes and create a new element in that form designer div?
drop: function( event, ui )
{
jQuery('<input/>',
{
type:
value:
}
).appendTo('#cartContent');
}
In this first case, this allows you to drag elements onto the form designer and create duplicates of the item, as seen in this jsFiddle demo:
To prevent items in the designer div from overlapping, I used this code shown in this demo: