• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2665

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

Add Country Specific Address State Code to Gravity Forms Address Fields for Non U.S Types

Gravity forms Country FieldsGravity forms is the most popular premium forms plugin for WordPress and one of the best plugins all round. If you’re a non U.S developer, you may need to customize the address fields to display states, provinces or regions for a specific country.

Gravity forms, out of the box, only displays United states & Canadian states with a default International field.

In this tutorial i’ll show you how to add  country filters to create non U.S address types for Australian state’s, U.K states and Brazilian states for custom address fields.

There’s already an International address type included but it doesn’t display specific countries or non U.S states.

Add this code to your theme’s functions.php file (A child theme or custom functions.php file is suggested otherwise your custom code will be lost when you update your theme).

Requirements

If you don’t already own a Gravity forms license, you’ll need to purchase Gravity forms license.

United Kingdom Address Type Code

If you’re not from any of these countries you could easily edit the above code for your own country and create address form fields using the excellent form plugin, Gravity forms.

Australian Address Type Code

I’ve already written several other posts on how to customize gravity forms and i’ll be writing more in the future as its such a hugely popular plugin.

Here’s another address type for Brazil:

Brazilian Address Type Code

If you have any other country code address types you have used already, you are welcome to send them to me which will help other Developers using the contact form.

Reader Interactions

Comments

  1. Peter says

    January 14, 2014 at 11:52 pm

    Please how can I add Kenya Address Type Code. normally use P.O. Box

    Thanks in advance.

    Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems