<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function onPasteMe(pObj) 
{     
// validate  pasted text     
var input  = window.clipboardData.getData('Text'); 
document.getElementById("txt1").value = input ;
var m= stripCharacters(input,pObj) ;
    if(m)
    {
 input=input.replace(/[\s]/g,'\r'); 
 var n=input.split(/\r/g).length; 
 alert(n);
    }
  }
function stripCharacters(input,pObj) {
var r = new RegExp("[^\\s\\r\\t\\n0-9]", "g");
var find = input.match(r) ;      
if(find)
   {   
 alert('String contains both alpha-numeric or your pre-defined special characters!');  
 pObj.innerHTML = ""; 
 return false; 
   }
 return true; 
}
</script>
</head>
<body>
<textarea cols=19 id = "txt1" onPaste="onPasteMe(this);"></textarea>
</body>
</html>
if i paste numbers in the text area like 1233445 the pasted value should present in the text area, but if i pasted values like assdfsdf 123243' or 2313adsdad the text area should get clear automatically???
i used below codes but its not worked for me please help,
pObj.innerHTML = "";
document.getElementById("txt1").value =""; 
 
     
     
    