How to use nodereference_select in custom form (set default value) D6 I am building a custom form using the Form API. I want to show a nodereference_select in my form. However I have some difficulties setting the default value and the list of values.

//Create array of values
$items['6039']="MT";

// add field
$field = content_fields('field_nodereference_select');
$form['#field_info']['field_nodereference_select'] = $field;
$form += content_field_form($form, $form_state, $field);
$form['field_nodereference_select']['#weight'] = 6;
$form['field_nodereference_select']['#default_value']=$items;
$form['field_nodereference_select']['#options']=$items;


When I render the form I see the widget but without any values.
When I am able to render the $items array, my next step would be to executing a view (because the nodereference_select is using a view to select certain values). and fill the $items array with the values.

Any help on this one?
I've managed to use such a field widget in a custom form in the following manner

  $field = content_fields('&lt;field name on a node type&gt;', '&lt;node type that uses this field&gt;');
  $form['#field_info']['&lt;field name on a node type&gt;'] = $field;
  $form += content_field_form($form, $form_state, $field);


I don't know if it would work without a node type actually having such a field.
I had a node type with that reference so I could "invoke" that.

The resulting form element does not look like a simple select element, it does not have '#options' and '#default_value' is fancy too.