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.

Modify "Zip Code" Label

  1. Hello team,
    Could you please tell me whereabouts I can find and modify the entry for the "Zip Code" label in the 'Address' function? (No Zip Codes here in Australia, only Post Codes!)

    Am using v1.4.3.1

    Many thanks
    Dan

    Posted 13 years ago on Tuesday September 28, 2010 | Permalink
  2. You can do this with a filter added to your functions.php file.

    this example would be for all forms

    <?php
    add_filter("gform_address_zip", "change_address_zip", 10, 2);
    function change_address_zip($label, $form_id){
        return "Post Code";
    }
    ?>

    and this specifically for a form ID 5

    <?php
    add_filter("gform_address_zip_5", "change_address_zip", 10, 2);
    function change_address_zip($label, $form_id){
        return "Post Code";
    }
    ?>
    Posted 13 years ago on Tuesday September 28, 2010 | Permalink
  3. ...and that's why you pays for Gravity Forms! Awesome stuff, thanks Kevin.

    Posted 13 years ago on Tuesday September 28, 2010 | Permalink
  4. Thanks for the update.. just happy I could help out. Let us know if you need anything else.

    Posted 13 years ago on Wednesday September 29, 2010 | Permalink
  5. ...umm actually, I may have been a little quick off the mark... the mod works fine, but in adding it to custom_functions.php (this build is using Thesis), it removes the ability to edit the form.

    Remove the code, and voila, back to normal. (Of course, this could actually be useful in preventing mistaken end-user editing!)

    Any ideas?

    Posted 13 years ago on Wednesday September 29, 2010 | Permalink
  6. I just tested this on a fresh Thesis 1.8 install and it worked fine.

    I added the snippet to the custom/custom_functions.php file.. right after the first comment.

    screenshot

    add_filter("gform_address_zip", "change_address_zip", 10, 2);
    function change_address_zip($label, $form_id){
        return "Post Code";
    }

    It changed the label as expected on the front end.

    screenshot - front end with filter added

    and I was able to submit the form without any difficulties

    screenshot - confirmation screen

    I guess I didn't specify in the example, but you need to remove the opening and closing php statements if you place the snippet inside of another.. not sure if that's your case but was worth a mention.

    Posted 13 years ago on Wednesday September 29, 2010 | Permalink
  7. Hi Kevin,
    Thanks again for your help. In reading back, I realise I could have explained that better - the error is in editing the form itself in the WP console, not in submitting it, i.e. the functions of the Form Editor are apparently disabled.

    Dan

    Posted 13 years ago on Wednesday September 29, 2010 | Permalink
  8. Dan, I should work on my reading comprehension. I DID read that you said EDIT the form but just lost that nugget somewhere along the way. Apologies.

    I've not been able to recreate any issues on either the front end or in the admin either. I'm able to edit the form normally. I'm using Thesis 1.8, WordPress 3.01 and the latest Gravity Forms release (1.4.3.1)

    Adding the filter is just a server-side function and shouldn't affect the form editor client side scripting. There's definitely something odd going on.

    If you'd like to send us a WP admin login and a FTP login, we'd be happy to jump in there and take a look. You can send the info via our contact form and we'll take a look at it asap.

    If you'll reference this topic URL in your message that would be helpful as well.

    Posted 13 years ago on Wednesday September 29, 2010 | Permalink
  9. Thanks Kevin, have just sent the email...

    Posted 13 years ago on Wednesday September 29, 2010 | Permalink
  10. Dan, I looked around at your forms and the custom functions file and had no luck. I've asked our lead developer to take a look at it and see what he can glean.

    I'm running a local install of Thesis 1.8 with the same version of the plugin and have no issues with the filter so i'm kind of stumped. We'll let you know what we figure out when he gets a chance to look at it.

    Posted 13 years ago on Sunday October 3, 2010 | Permalink
  11. Dan, Alex looked into this for you and emailed you with some info.

    Posted 13 years ago on Sunday October 3, 2010 | Permalink
  12. gregreimer
    Member

    Same here, unfortunately. When the code is in the functions.php file, I cannot edit the form in the backend. I'm using my own theme built from scratch.

    Posted 13 years ago on Thursday October 14, 2010 | Permalink
  13. If you copy and paste the code snippet you are using here, I can take a look at it and fix it for you.

    Posted 13 years ago on Thursday October 14, 2010 | Permalink