Ajax call while adding node
You'll need to use a validation function alongside an ajax call to check for validity, you might want to look at other solutions like How to validate and submit a form using AJAX? to get an idea about how this could be done.

If you are using the Addressfield module (D7) you may find some of these problems are already taken care of, or are easier to solve than with a standard set of input fields.