views:

34

answers:

1

In the latest project I'm undertaking, I need to be able to drag a div element from a list and drop it into a textbox. The project itself has a strong messaging component and I'd like to have the functionality to drag contacts from a contact list and place them in a "recipient" textbox containing one or more recipients, comma delimited.

I've figured out dragging and dropping from here, but I can't for the life of me figure out a way to populate a textbox by dropping a div item onto it.

I'd appreciate any assistance.

+2  A: 

I made a jsfiddle that uses jQuery and jQuery UI to achieve what you were looking for. In my example I replace the contents of the text box on drop, but you could easily alter this to append.

Nate Pinchot
Thank you very much! This is just what I was looking for.
treefrog