Add dropdown from post from two or more categories
wpcf7_add_shortcode('postdropdown', 'createbox', true);
function createbox(){
global $post;
$args1 = array('numberposts' => 0, 'category' => 14 );
$myposts1 = get_posts( $args1 );
$args2 = array('numberposts' => 0, 'category' => 19 );
$myposts2 = get_posts( $args2 );
$myposts = array_merge($myposts1, $myposts2);
$output = "<select name='cursus' id='cursus' onchange='document.getElementById(\"cursus\").value=this.value;'><option></option>";
foreach ( $myposts as $post ) : setup_postdata($post);
$title = get_the_title();
$output .= "<option value='$title'> $title </option>";
endforeach;
$output .= "</select>";
return $output;
}