Even if a zip code contains multiple cities, each ZIP has one "preferred" locality name and you can default to that. Any of the locality names within a zip code is deliverable for all addresses in that zip code.
As has been pointed out in many other comments implicitly and explicitly, the purpose of a set of address fields in an HTML form is not always to come up with a USPS delivery address.
As has been pointed out in many other comments implicitly and explicitly, the purpose of a set of address fields in an HTML form is not always to come up with a USPS delivery address.