I'm having to add a section to my site where the user chooses a UK mainland country, then the counties for that Country show up.
I thought I may as well put the code here for you all to have, saving you from also having to do it.
I've also included the form that I tested this on, so you can just add that if you prefer. please note that the form also includes 1 set of towns (when England>>Somerset has been selected).
Here is the form for you to import:
http://www.film-agency.com/downloads/location_example.xml
Here is the code, which needs to be added to your functions.php file:
add_filter("gform_predefined_choices", "add_predefined_choice");
function add_predefined_choice($choices){
$choices["British Mainland Countries"] = array("England", "Scotland", "Wales");
$choices["English Counties"] = array("Bedfordshire", "Berkshire", "Buckinghamshire", "Cambridgeshire", "Cheshire", "Cornwall", "Cumberland", "Derbyshire", "Devon", "Dorset", "Durham", "Essex", "Gloucestershire", "Hampshire", "Herefordshire", "Hertfordshire", "Huntingdonshire", "Kent", "Lancashire", "Leicestershire", "Lincolnshire", "Middlesex", "Norfolk", "Northamptonshire", "Northumberland", "Nottinghamshire", "Oxfordshire", "Rutland", "Shropshire", "Somerset", "Staffordshire", "Suffolk", "Surrey", "Sussex", "Warwickshire", "Westmorland", "Wiltshire", "Worcestershire", "Yorkshire");
$choices["Scottish Counties"] = array("Aberdeenshire", "Angus", "Argyllshire", "Ayrshire", "Banffshire", "Berwickshire", "Buteshire", "Cromartyshire", "Caithness", "Clackmannanshire", "Dumfriesshire", "Dunbartonshire", "East Lothian", "Fife", "Inverness-shire", "Kincardineshire", "Kinross-shire", "Kirkcudbrightshire", "Lanarkshire", "Midlothian", "Morayshire", "Nairnshire", "Orkney", "Peeblesshire", "Perthshire", "Renfrewshire", "Ross-shire", "Roxburghshire", "Selkirkshire", "Shetland", "Stirlingshire", "Sutherland", "West Lothian", "Wigtownshire");
$choices["Welsh Counties"] = array("Anglesey", "Brecknockshire", "Caernarfonshire", "Carmarthenshire", "Cardiganshire", "Denbighshire", "Flintshire", "Glamorgan", "Merioneth", "Monmouthshire", "Montgomeryshire", "Pembrokeshire", "Radnorshire");
return $choices;
}
When I've completed all the main towns for each County, I'll share the code :o)