Get form select field values from view I'm struggling to find a working method for populating the key &amp; value pairs of a select field (created with forms api) with data from a view.

e.g.. I have a view of 'location' content types.

In the form I've created I need a drop down showing all these location names and a reference from their content type as the key.

Can anyone suggest the easiest method?
In lieu of using Views to handle the query, for performance reasons you are probably better off doing something more direct with the db, just make sure that you follow standards for security when accessing the db via any method. Here is a link to the Writing Secure Code documentation - a must read for anyone delving into this area.