Aspdotnet-Suresh

aspdotnet-suresh offers C#.net articles and tutorials,csharp dot net,asp.net articles and tutorials,VB.NET Articles,Gridview articles,code examples of asp.net 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies

Disable Drag and Drop Option in Textbox or Textarea Controls

Feb 28, 2013
Introduction

Here I will explain how to disable drag and drop option in textbox or textarea using JavaScript properties. 

Description:
  
In previous articles I explained JavaScript show number of characters left, JavaScript restrict user to enter only numbers, JavaScript allow limited characters in textarea, JavaScript remove special characters from textbox and many articles relating to
JavaScript, jQuery, asp.net. Now I will explain how to disable drag and drop option in textbox or textarea.

Previously I written one post JavaScript remove special characters from textbox to remove special characters from textbox at that time one reader has asked me the question like 

“Textbox removing special characters whenever I enter but if I select some special characters text and hold the text by mouse click and drop it in textbox it’s allowing how to restrict that drag and drop option?”

To stop drag and drop option in textbox or textarea we need to set some of properties in body tag for that check below 


<html>
<head>
</head>
<body ondragstart="return false" draggable="false">
<b>Try to Drag and Drop Text Here :</b> <input type="text" name="txt" id="txtname" />
</body>
</html>
Live Demo

For live demo try to select some text drag and drop in textbox

Try to Drag and Drop Text Here :

If you enjoyed this post, please support the blog below. It's FREE!

Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email

3 comments :

Rashmi said...

how to send sms on mobile using asp.net web pages?

Anonymous said...

how to add tab using asp.net web pages?

Rahul Pundir said...

how to send sms in asp.net Plz tell me ?

Give your Valuable Comments

Other Related Posts

© 2010-2012 Aspdotnet-Suresh.com. All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.