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?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Chris StanyonConnect With a Mentor Commented:
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 MontyConnect With a Mentor Senior 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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
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
All Courses

From novice to tech pro — start learning today.