$('#ValidatedInput').keydown(function(evt) {// If enter is pressedif (evt.keyCode === 13) {evt.preventDefault();
// If changes have been made to the input's value,// blur() will result in a change event being fired.this.blur();}});
$('#ValidatedInput').change(function(evt) {var valueToValidate = this.value;
// Your validation callback/logic here.});