Hello,
Just purchashed the gravity form (very awesome btw) But I nog added a list to my form filled with post. like explained on http://www.gravityhelp.com/forums/topic/automatically-populate-a-dropdown-with-post-titles
It seems to word fine however the post which are shown are from the wrong category! When you to to http://www.geneeskundebaan.nl/demo/solliciteer/ the first field is supposed to load the post from category "vacatures" but is showing post from the category "portfolio" instead.
I use this code in mij functions.php:
'//Adds a filter to form id 14. Replace 14 with your actual form id
add_filter("gform_pre_render_1", populate_dropdown);
function populate_dropdown($form){
//Reading posts for "Business" category;
$posts = get_posts("category=vacatures");
//Creating drop down item array.
$items = array();
//Adding initial blank value.
$items[] = array("text" => "", "value" => "");
//Adding post titles to the items array
foreach($posts as $post)
$items[] = array("value" => $post->post_title, "text" => $post->post_title);
//Adding items to field id 8. Replace 8 with your actual field id. You can get the field id by looking at the input name in the markup.
foreach($form["fields"] as &$field)
if($field["id"] == 35){
$field["type"] = "select";
$field["choices"] = $items;
}
return $form;
}'