I have a feed for UPS that gets real time shipping costs for packages shipped throughout the US. The feed works fine, except if someone enters AE or AP as the state if they are shipping to a military base overseas.

I get this error:

111286:AE is not a valid state abbreviation for United States.

Any suggestions?

Check for special cases first, then attempt to validate the state using your existing approach.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.