useing this code I avoid to paste invalid chracters to textboxes.
function PasteAlphaNumeric(objEvent)
{
var strPasteData = window.clipboardData.getData("Text");
var objInput = objEvent.srcElement;
if (strPasteData.search("[^A-Za-z0-9]")!=-1) {
alert("The character you attempted to paste is not allowed for this field.");
objInput.focus();
return false;
}
}
I want to allow to paste white space characters (\s) and[A-Za-z0-9] to the textbox, how can I do this.