By using event.key we can get values prior entry into HTML Input Text Box. Here is the code.
function checkText()_x000D_
{_x000D_
console.log("Value Entered which was prevented was - " + event.key);_x000D_
_x000D_
//Following will prevent displaying value on textbox_x000D_
//You need to use your validation functions here and return value true or false._x000D_
return false;_x000D_
}
_x000D_
<input type="text" placeholder="Enter Value" onkeypress="return checkText()" />
_x000D_