document.onkeypress=keyPressed;

function keyPressed(e)
{
    var n;

    (window.Event) ? n=e.which : n=event.keyCode;
    if( n==8 || n==13 || n==11) return true;

    return validateKeyPress( String.fromCharCode(n));
}


function validateKeyPress( ch)
{
    //if( " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.-_@,:;&".indexOf( ch) == -1)
    if("'<>".indexOf(ch) !=-1)
        return false;
    else
        return true;
}
