I'd love to add the US states and Canadian Provinces to the same list, but currently, there doesn't seem to be a way to easily do that.
I'd love to add the US states and Canadian Provinces to the same list, but currently, there doesn't seem to be a way to easily do that.
Dave,
With a little bit of code, you can add your own predefined list with both U.S. States and Canadian Provinces. You can then easily select that predefined choice when creating fields.
add_filter("gform_predefined_choices", "add_predefined_choice");
function add_predefined_choice($choices){
$choices["US/Canadian Regions"] = array("Virginia", "Augusta", "XXXX");
return $choices;
}
Alex code snippet is for adding your own Predefined Choices. Is this what you are referring to David?
You have both as options, but I can't add both Canadian Provinces and US States to one drop down selection
David,
You can paste whatever you'd like into the bulk editor, just copy the provinces list and paste it in with the US states list... should work fine.
Alberta British Columbia Manitoba New Brunswick Newfoundland & Labrador Northwest Territories Nova Scotia Nunavut Ontario Prince Edward Island Quebec Saskatchewan Yukon Alabama Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont Virginia Washington West Virginia Wisconsin Wyoming
Yea, like Kevin mentioned you can do some copy-n-paste and make your own list. The Pre-Defined options interface also lets you bulk add your own options by editing what is in the lefthand pane of the Bulk Add/Pre-Defined Choices interface.
Is there any special reason why I can't select multiple lists though? Just out of curiosity now...lol..
The pre-defined lists are just templates. You pick one, it populates the drop down. It wasn't setup to allow you to pick multiple pre-defined data types because typical usage isn't going to involve doing so. If you need to do anything unusual you can modify the data however you want using the bulk editor in the same interface.
So I copy past a list of fields in the bulk add dialogue
Can I then sort the bulk added fields?
A-z z-a etcetera?
It would be nice as well if we could save the list as custom
so we can select at a later date again
Hi, for the code snippet? What value will I need to put on the "Default Value"?
@deukdesign You can create your own custom list that will always be available using the code snippet Alex provided above. That is used to create a custom bulkadd/predefined list of options that is available when using that feature.
@Gavin I'm not sure what you mean by put on the "Default Value", can you elaborate?