Can I get custom post items in select box (dropdown)

Google code for displaying custom post items. Fetch all the custom post items in an array and then use a simple html of a drop down and put it in a for loop which will go through all the elements of custom post type. In the value attribute of drop down use the current array value.

Below is the html code for drop down wrap it in a for loop and add values as custom post type items.

You can also fetch your cost post related items using wpdb class of WordPress using a select query before this.

for each (result as results)
{?>
<select>
  <option value="<?php echo results->custompostItem ?>">Volvo</option>

</select>
<?php}