On Aug 20, 4:47 pm, "Web Specialist" <[EMAIL PROTECTED]> wrote: > I'm looking a script to disable users to paste content in forms using > ctrl+v. How to avoid that?
Since that facility is provided independent of JS by the underlying native widgets (often at a deeper level than the browser application itself), i don't believe this can be done from JS. Also, removing a facility which a user expects to work everywhere is poor practice, as it leads to a confusing user experience. As a user it would really piss me off to find out that copy/paste is disabled for a specific field/form. Widgets which do disable copy/paste are normally coded at the level of the underlying UI toolkit. The only example i'm aware of in the real world is password fields, which often disable copy/paste. If the underlying UI toolkit has a password-style field which prohibits copy/ paste AND the browser uses this widget type for <input type='password'> fields, then you inherit this functionality, otherwise i don't think it can be reliably achieved via JS. Consider, too, that a user can disable JS to re-enable copy/paste.