Modifying the properties and output of a select list when adding content with the admin Drupal 7 I have a type of content. Depending on the domain (I use Domain Access), I want to show a different content in a field which is a select list with reference to term. By several reasons, I do need to do this programmaticaly, to have full control. Also need to change the property: "required" of the field on-the-fly. What hook should I use, is there some example where I can look at? Thanks.
You need hook_form_FORM_ID_alter() or hook_form_alter() to modify the select list. Something like this should work:

// form_alter hook for "mycontent" content type.
function mymodule_form_mycontent_node_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  switch ($_SERVER['SERVER_NAME']) {
    case 'domain1.example.com':
      // Remove term 2 from select list.
      unset($form['field_myfield']['und']['#options'][2]);
      break;
    case 'domain2.example.com':
      // Make term reference field required.
      $form['field_myfield']['und']['#required'] = TRUE;
      break;
  }
}


Bear in mind that you can't just add new terms to the select list since they will fail validation when the form is submitted. You can only choose which existing terms to include in the list.

What you could also do is create different fields for different groups of terms and unset whole fields depending on the domain so that only the relevant field is displayed.