How to remove dropdown items from a form? I am trying to remove two select list items from a form using this code:

function module_r_form_alter(&amp;$form, &amp;$form_state, $form_id)
{     
    if ($form_id == 'forum-node-form') {
        unset($form['edit-taxonomy-forums-und']['#options']['_none']);
        unset($form['edit-taxonomy-forums-und']['#options']['4']);
    }
}


The above code is not working. I would greatly appreciate any help you can give me in working this problem.
If the name of your field is edit-taxonomy-forums-und your code should be:

unset($form['edit-taxonomy-forums-und'][LANGUAGE_NONE]['#options']['4']);


Maybe you don't have the correct name of the field. Go to the Manage fields page of your content type (YOUR_SITE/admin/structure/types/manage/YOUR_CONTENT_TYPE/fields) and check the name of the field.



EDIT:

If you read the comments in the answer you will see that the problem was the change of forum_node_form by forum-node-form.