I have something like:
Your code seems to work as expected for me. See this fiddle. Are you seeing some other behavior? I see that I type a number in textbox1. Then when I tab over to textbox2 I get Invalid Part!
error and focus stays on current textbox.
Updated - Since this only seems to play nice in Chrome you could keep track of whether an error exists. If so then handle it.
var error = null;
function checkForErrors() {
if (error) { error.focus(); error = null; }
}
function validatePart(node) {
if (badpart) { error = node; }
}
function saveOldQuantity(node) {
checkForErrors();
}