How to Validate Gravity Forms Address Fields:
Recently, the need to validate the zip code in a standard address field using Gravity Forms arose for a client. Following the documentation provided for developers with the most recent to date paid Commercial Version, we set up a zip code validation. Seemed easy enough.
To Use State Abbreviations : Gravity Forms, you will not just need the excellent Gravity Forms Plugin for WordPress, but you will also need a Commercial License to allow the code below to work.
The code is added to a proper Child Theme Functions.php file. If you are not using a Child Theme, I suggest you set one up first. Edits to Parent Theme’s are lost on Theme Updates. (That means if you need to update your theme, you will have to redo this work, so a Child Theme is always advised.)