Hi, is it possible to create our own fields?
I'd like to tweak the address field that is included with Gravity Forms, changing some of the defaults. We have our own list of states/provinces and countries that we need to use.
Thanks.
Hi, is it possible to create our own fields?
I'd like to tweak the address field that is included with Gravity Forms, changing some of the defaults. We have our own list of states/provinces and countries that we need to use.
Thanks.
Currently it is not possible, however we do plan on adding some hooks down the road that would allow you to do this. It's on our to do list. But it probably won't be in the next release.
Ok, thanks.
...but you can update the content of these fields before the form is rendered use the Gravity Forms "gform_pre_render_*formid*" hook. Here is a sample of its usage pulled from the Gravity Forms change log:
add_filter("gform_pre_render_17", test_render); //Adds a filter to form id 17. It is also possible to use gform_pre_render to filter every form
function test_render($form){
$form["fields"][1]["isRequired"] = true; //Dynamically marks a field (id=1) as required
return $form;
}
I've used this function several times when needing to update the values available for a particular field in the form. You could similarly replace the default list of states/provinces with your own using this hook.
Very interesting, thanks.
Thanks again for this. I found some other sample code which seems to do the trick for separate <select> fields:
http://forum.gravityhelp.com/topic/drop-down-value-different-than-content-text
But, I can't get this to work for the "Country" which is part of an 'address field.'
The id is something like 9.6.
Seems as though the countries are hard-coded, in a way.
Any ideas?
(Of course, Carl did say this was not possible...)
Thanks-
Bill