How to use select dropdown with entries/saveEntry for an entry field? How to use select dropdown with entries/saveEntry for an entry field?

I have an entry with a field that is another entry, which I want to update with a form:

&lt;form method="post" accept-charset="UTF-8"&gt;
  {{ getCsrfInput() }}
  &lt;input type="hidden" name="action" value="entries/saveEntry"&gt;
  &lt;input type="hidden" name="entryId" value="{{ entry.id }}"&gt;
  &lt;label&gt;Vendor
    &lt;select name="fields[vendor][]"&gt;
      &lt;option&gt;---&lt;/option&gt;
      {% for v in craft.entries.section('vendors') %}
        &lt;option value="{{v.id}}"&gt;{{v.title}}&lt;/option&gt;
      {% endfor %}
    &lt;/select&gt;
  &lt;/label&gt;
  &lt;input type="submit" value="Submit"/&gt;
&lt;/form&gt;


This works fine, except if nothing is selected in the dropdown (&lt;option&gt;---&lt;/option&gt;). In that case, the POST value for fields[vendor][] is ---, and I get a SQL foreign key constraint error.

I have also tried &lt;option value=""&gt;---&lt;/option&gt; and &lt;option value="NULL"&gt;---&lt;/option&gt; with no better outcome.
I ran into this a while ago and it drove me nuts. Try adding disabled and selected attributes to your initial option in the select. So in your case &lt;option disabled selected&gt;---&lt;/option&gt;.