What im trying to do is easy in theory but I am having a heck of a time getting it to work. The part I am having trouble with is the zipcode validation. The validation works but after telling you its an invalid zipcode I want it to go back to the zipcode field for the user to try again. All of this should be accomplished onblur. Here is the full pages code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> </head> <body onload="toForm()"> <form name="test"> <input type="text" id="PostalCode" name="PostalCode" value="" onblur="lookup()" /> <input type="text" id="DealerIA_OA" name="DealerIA_OA" value="" /> <input type="text" id="MuzakDealer" name="MuzakDealer" value="" /> </form> <script> function lookup(){ /////start zip validation var field = document.getElementById('PostalCode').value; var valid = "0123456789-"; var hyphencount = 0; if (field.length!=5 && field.length!=10) { alert("Please enter your 5 digit or 5 digit+4 zip code."); return false; document.forms.test.PostalCode.focus(); } for (var i=0; i < field.length; i++) { temp = "" + field.substring(i, i+1); if (temp == "-") hyphencount++; if (valid.indexOf(temp) == "-1") { alert("Invalid characters in your zip code. Please try again."); PostalCode.focus(); PostalCode.select(); } if ((hyphencount > 1) || ((field.length==10) && ""+field.charAt(5)!="-")) { alert("The hyphen character should be used with a properly formatted 5 digit+four zip code, like '12345-6789'. Please try again."); PostalCode.focus(); PostalCode.select(); } } //////end zip validation var zpcode = document.getElementById('PostalCode').value; jQuery.getJSON("http://muzak-dealers.heroku.com/dealers/" + zpcode + "?security_token=A26F777D-EA30-4F15-B956-648662E34F17&callback=?", function(data) { $("#DealerIA_OA").val(''); $("#MuzakDealer").val(''); $("#DealerIA_OA").val(data["ia_or_oa"]); $("#MuzakDealer").val(data["name"]); }); } </script> Code (markup): Basically you type in an invalid zipcode in the first field and it will show an alert then after clicking ok it needs to go back to the zip code field not the next field. Thank you in advance.