SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Addict SunnaH's Avatar
    Join Date
    Aug 2005
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Prevent dragging and dropping links

    Must CSS and JavaScript be used together to prevent dragging and dropping links? For example, if there is a label next to input field. The label is a text. I want to investigate if the user can be prevented from dragging the text link into the input field. I can use
    Code:
     -webkit-touch-callout: none; . . .
    but I am still able to drag that text link into the input area. At the same time I do not want to prevent all dragging as I want the user to be able to drag to the URL location bar. I just want it to effect all text links of this particuar style.
    -=SunnaH=-

  2. #2
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,742
    Mentioned
    32 Post(s)
    Tagged
    1 Thread(s)
    I am not entirely certain what you are asking, but If I get what you are saying correctly.... on a web page.. its an ALL or NOTHING thing. The text/link is is accessible for the user to do what s/he wishes or its not accessible and the user can do nothing with it.

    YOU can , after the fact and using .js ( as CSS only controls appearance, not function) , validate the value of an input to make sure it's valid. In fact , this is a far more logical method that to prevent someone from dragging text or copying a link ( what if they drag a link from another webpage that they have open at the same time... how could you even prevent that?)

    In short, validate your form inputs, display error messages if values do not conform to what you were expecting.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •