Solved

Drag n drop value

Posted on 2013-11-20
7
311 Views
Last Modified: 2013-11-20
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
0
Comment
Question by:Gary
  • 4
  • 2
7 Comments
 
LVL 42

Expert Comment

by:Chris Stanyon
Comment Utility
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
 
LVL 32

Assisted Solution

by:Big Monty
Big Monty earned 100 total points
Comment Utility
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
 
LVL 58

Author Comment

by:Gary
Comment Utility
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 42

Expert Comment

by:Chris Stanyon
Comment Utility
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
 
LVL 42

Accepted Solution

by:
Chris Stanyon earned 400 total points
Comment Utility
Not sure what your requirements are, but have a play with this:

http://jsfiddle.net/ChrisStanyon/6v5TK/
0
 
LVL 58

Author Closing Comment

by:Gary
Comment Utility
Doesn't work in IE, but I can live with that.
0
 
LVL 42

Expert Comment

by:Chris Stanyon
Comment Utility
Doesn't work in IE, but I can live with that.

Unfortunately, we all have to!!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now