I have written this code in js to validate my text in an html input field. It works great except that I can't copy/paste anything into the textbox. How can I modify this to allow copy/pasting while not losing the validation functionality? Or is there a better way to validate a textbox?
function checkText(e)
{
var ok = /[a-z A-Z]/.test(String.fromCharCode(e.charCode));
if (!ok)
e.preventDefault();
}