PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Changing address fields

  1. dochara
    Member

    I'm in Ireland. We don't have ZIP codes at all. I've a site that only serves Ireland and would like to use the address layout, but no zip.

    Also, the naming of other fields is a bit... foreign.

    We don't have states, provinces are irrelevant as are regions - counties on the other hand are important. Anyway to change the language there?

    Posted 12 years ago on Wednesday May 25, 2011 | Permalink
  2. I'm sure the GF team will provide a more technical way to solve this but here's what I would do. Using the standard and advance fields I would just build my own address section. To replicate the look of the default address option I would then use the CSS Ready Classes to aligning the fields.
    Here's documentation about CSS Ready Classes:
    http://www.gravityhelp.com/documentation/page/CSS_Ready_Classes

    Posted 12 years ago on Thursday May 26, 2011 | Permalink
  3. @dochara Unfortunately we can't take into account all address formats across all countries. The international format is designed to take into account most usage across the globe. The sublabels on the Address field can be customized using WordPress filters. So you can change "state/province/region" to "Counties" if that is what you want to do using the available filters.

    Here is a list of all the advanced field sublabel filters:

    http://www.gravityhelp.com/documentation/page/Developer_Docs#Sublabels

    Currently there is not a way to hide the zip code field, you would have to use CSS to set that element to display: none; by adding custom CSS to your themes stylesheet.

    There is also a hook available that lets you create your own custom Address type. You can find information on it here:

    http://www.gravityhelp.com/documentation/page/Gform_address_types

    Posted 12 years ago on Thursday May 26, 2011 | Permalink
  4. lerizzle
    Member

    Would there be a hook to simply remove zip from a canadian address. I don't care about the zip but I need the address to be required. Simply using css will fail the validation no?

    Posted 12 years ago on Tuesday January 24, 2012 | Permalink
  5. Ive created this for irish addresses.. you can just add this to the themes functions.php file

    Note: but Im also looking for a way to simply remove zip / postal code.
    my issue is that the address field is required so even hiding it via css doesnt work and causes a validation error.

    add_filter("gform_address_types", "irish_address", 10, 2);
    function irish_address($address_types, $form_id){
    $address_types["irish"] = array(
    "label" => "Irish",
    "country" => "Ireland",
    "zip_label" => "Postcode",
    "state_label" => "County",
    "states" => array("Antrim"=>"Antrim","Armagh"=>"Armagh","Carlow"=>"Carlow","Cavan"=>"Cavan","Clare"=>"Clare","Cork"=>"Cork","Derry"=>"Derry","Donegal"=>"Donegal","Down"=>"Down","Dublin"=>"Dublin","Fermanagh"=>"Fermanagh","Galway"=>"Galway","Kerry"=>"Kerry","Kildare"=>"Kildare", "Kilkenny"=>"Kilkenny","Laois"=>"Laois","Leitrim"=>"Leitrim","Limerick"=>"Limerick","Longford"=>"Longford","Louth"=>"Louth","Mayo"=>"Mayo","Meath"=>"Meath","Monaghan"=>"Monaghan","Offaly"=>"Offaly","Roscommon"=>"Roscommon","Sligo"=>"Sligo","Tipperary"=>"Tipperary","Tyrone"=>"Tyrone","Waterford"=>"Waterford","Westmeath"=>"Westmeath","Wexford"=>"Wexford","Wicklow"=>"Wicklow")
    );
    return $address_types;
    }
    Posted 11 years ago on Monday October 22, 2012 | Permalink