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
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
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";
}
?>
...and that's why you pays for Gravity Forms! Awesome stuff, thanks Kevin.
Thanks for the update.. just happy I could help out. Let us know if you need anything else.
...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?
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.
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.
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
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.
Thanks Kevin, have just sent the email...
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.
Dan, Alex looked into this for you and emailed you with some info.
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.
If you copy and paste the code snippet you are using here, I can take a look at it and fix it for you.