I would like to be able to create a draggable element in script.aculo.us that I can then drag a copy of (ghost) into a text box (input type=text) ... upon releasing the ghosted element within the text box, the text box will then be filled with the text from the draggable element. If anyone has any links to explanations of how to do this, or can provide me with even a small code snippet that could get me started, I would greatly appreciate it Thank you very much, Mike --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2007-Feb-16 14:42 UTC
Re: script.aculo.us - drag + drop text into text box
Hey Mike, Mike a écrit :> I would like to be able to create a draggable element in > script.aculo.us that I can then drag a copy of (ghost) into a text box > (input type=text) ... upon releasing the ghosted element within the > text box, the text box will then be filled with the text from the > draggable element.You''ll need to create your Draggable (new Draggable(...)) with the ghost option, then to make the textbox droppable (Droppables.add(...)), and provide the proper onDrop handlers to get the draggable element being dropped and fetch its content text, then assign it to your textbox''s "value" property. As for grabbing the text, it very much depends on what''s inside your draggable element. I''m no big fan of innerHTML, but I suspect e.innerHTML.stripTags() would do OK. -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---