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
-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.
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.