Change form list default value I want to change the default -select a value- from a text list to a something like -please select a choice- 



This is what I have:

  function project_form_alter(&amp;$form, &amp;$form_state, $form_id){
    if($form['#id'] == 'edit-field-gen-list'){
    $form['field_gen_list']['#default_value'] = 'all';
    }
}


It's not picking up the value.



This is the HTML.
In Drupal 8 type-hint $form_state with the FormStateInterface &amp; do not pass it by reference:

hook_form_alter(&amp;$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id)


See hook_form_alter() for further reference.
I see some confusion on your usage of the $form_id / $form['#id']. Dump your $form_id in the hook &amp; see which is the correct form you want to alter. Because as others have mentioned already: edit-field-gen-list is not your form id but your field_gen_list field id. For example: the form id of the contact Website feedback is contact_message_feedback_form.
Given the HTML in your question, your $form['field_gen_list']['widget']['#options'] will not have a key for 'all'. So adding that as default value will not work unless you add such a key value to the options array

So instead try this:

function project_form_alter(&amp;$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id)
{
    kint($form_id, 'Find correct form id');

    if ($form_id == 'contact_message_feedback_form') { // Change this

        // Add an 'all' key value option
        $form['field_gen_list']['widget']['#options']['all'] = '- All -';

        // Set newly added key 'all' as default value
        $form['field_gen_list']['widget']['#default_value'] = 'all';
    }

}