Disable select option I have a select list in my registration form here. The user can select 3 options to register for the event. For now the user has the ability to choose an early bird registration. After the periode they shouldn't be able to select that option. Is there a way to disable that option?

I have the following options:


EARLY BIRD REGISTRATION (now - Nov 1) 
REGULAR REGISTRATION (Nov 1 - Mar 1)
LATE REGISTRATION Mar (1 - to conference)
SPEAKERS REGISTRATION ( now to Apr 2)
STUDENT REGISTRATION (breaks only)


After the 1nov I should be able to disable the early bird registration in the select list.
Disabling single options from select lists is currently not that easy in Drupal. There are some open issues regarding the topic and a couple of suggested patches, but so far neither made it into core: 


Allow FAPI select, radios, and checkboxes to specify some options as disabled
Introduce proper Form API #types for 'option' and 'optgroup', and make #options consistent
Using form_alter to disable ONE option of a select field




That said, there is a tutorial on Exove which works around the issue, by implementing the THEME_select() hook to enable theming of individual select options using a #options_attributes key: Drupal 7 Form API select element option attributes

Using the code for your theme's template.php from the tutorial, you can disable options in your form using hook_form_FORM_ID_alter().

function hook_form_FORM_ID_alter() {
  $today = date("Y-m-d H:i:s");
  $date = "2016-11-01 00:00:00";

  if ($date &gt; $today) {
    //replace 0 with the actual index for Early Bird
    $form['your_select_field']['#option_attributes'][0] = array('disabled' =&gt; 'true');

    //set the other fields based on dates here
  }
}


There is also a module which seems to offer the same functionality as the theme code from the tutorial, but I have not yet tested it: Form Options Attributes. It seems to work in a similar fashion however and might be even a little easier to set up (since you don't need to write that theme function).