I have an AJAX application for a form that has 4 columns and 170 rows. It uses an onblur call to update a database each time you move out of a cell. This works fine. Client wanted to validate for a number so I added a function to check for this and an alert call if the numer check failed. This works fine. However, dismissing the alert results in the focus moving to the next cell rather than returning to the invalid cell. Big problem. I have been successful in hard coding focus to go to any other cell in the table except the one with the errror. Here is the pertinent table code: <td width="75"> <input type="text" name="depletions<?PHP echo $ti1; ?>" tabindex="<?PHP echo $ti1; ?>" id="depletions<?PHP echo $ti1; ?>" class="validate required depletions|<?PHP echo $id; ?> <?PHP echo $dbid; ?> usermsg depletions<?PHP echo $ti1; ?>" value="<?PHP echo $row['depletions']; ?>" size="8" /></td> <td width="75"> <input type="text" name="endinginventory" tabindex="<?PHP echo $ti2; ?>" id="endinginventory" class="validate required endinginventory|<?PHP echo $id; ?> <?PHP echo $dbid; ?> usermsg" value="<?PHP echo $row['endinginventory']; ?>" size="8" /></td> Here is the the function in my javascript file: function validateMe(objInput) { sVal = objInput.value; //get value inside of input field sRules = objInput.className.split(' '); // get all the rules from the input box classname sRequired = sRules[1]; // determines if field is required or not sTypeCheck = sRules[2]; //typecheck are additional validation rules (ie. email, phone, date) gShow = sRules[4]; //gShow is the td id where feedback is sent to. sTable = sRules[3]; // database table to access sSource = sRules[5]; if (isNaN (sVal)) { alert("Please enter a number."); document.form1.sSource.focus(); return false; } //sends the rules and value to the asp page to be validated http.open("GET", sUrl + (sVal) + "&sRequired=" + (sRequired) + "&sTypeCheck=" + sTypeCheck +"&sTable=" + sTable, true); http.onreadystatechange = handleHttpResponse; // handle what to do with the feedback http.send(null); } Any help in getting focus on the correct cell when the alert is dismissed will be greatly appreciated.