Drag n drop value

Normally if you drag an image to an input it will put the image src in the input.
Is there a way to intercept this and place the image id in the textbox instead?
Or if not an image then some other way to do a drag n drop of a value/id etc

Preferably without jQuery UI
LVL 58
GaryAsked:
Who is Participating?
 
Chris StanyonCommented:
Not sure what your requirements are, but have a play with this:

http://jsfiddle.net/ChrisStanyon/6v5TK/
0
 
Chris StanyonCommented:
Hey Gary,

I think you'll find this behaviours is specific to the OS and not the browser - certainly not HTML, so I think you'll struggle to hook into it.

Any specific reason you don't want to use jQueryUI - it's a breeze with that.
0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
using straight javascript, you could try using the onkeyup to detect the drag of some text. from there, it's just a matter of parsing out the string you want
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
GaryAuthor Commented:
I have found an example using the UI, I did say no UI but thinking about it, it is only for my backend so I can live with it.
This is what I found in the meantime and seems to work fine
http://jsfiddle.net/dv3EL/76/
0
 
Chris StanyonCommented:
You're not just limited to getting the ID - along with data attributes you can store whatever data you like and transfer that into your droppable :)
0
 
GaryAuthor Commented:
Doesn't work in IE, but I can live with that.
0
 
Chris StanyonCommented:
Doesn't work in IE, but I can live with that.

Unfortunately, we all have to!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.