how to have conditional required fields through hook_form_alter? Here is basically what I'm trying to do.
If the draft field is present I would like to make the name field not required.

if($form_state['values']['field_draft']['und'][0]['value']){
  $form['field_name']['und']['#required'] = FALSE; }


Is this even possible? I tried after_build but it doesn't work.  If not, is there a better way to add draft functionality through hook_form_alter.

Thanks!
In Drupal 7, I would use the following code.

/*
 * Implements hook_form_alter().
 */
function test_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  switch ($form_id) {
    case 'your_form_id':
      $lang = $form['name_field']['#language'];//get field language
      if(isset($form_state['values']['field_draft'][$lang][0]['value'])){
        $form['name_field'][$lang][0]['value']['#required'] = FALSE;
      }
      break;
  }
}


Note: Never use und try to get the language for multilingual sites. If site is not multilingual, then best to use the constant LANGUAGE_NONE and not the string 'und'.