disable text drag and drop

Viewed 27971

There is a common feature of modern browsers where a user can select some text and drag it to an input field. Within the same field it causes moving of text, between different fields it does copying. How do I disable that? If there is no portable way, I am mostly interested in firefox. This is an intranet webapp, so I am also interested in modifying the browser/getting a plugin to do this. Maybe some system-level settings (I`m on windows XP)?

I need to keep the default select-copy-paste functionality.

The background is I have multiple-field data entry forms, and users often drag something by mistake.

7 Answers

You can use :focus attribute to recognize over what your mouse is:

        if(document.activeElement.tagName == "INPUT"||document.activeElement.tagName == "TEXTAREA"){
            event.preventDefault()
            return
        }
Related