Programmatically set the number of Multiple Value CCK fields in node edit form I have a filefield multi-value CCK field and I want to be able to set the number of values that can be added based on some condition when the user is editing the existing node. Is there a way to handle this through a form_alter? I do not want to set the number of values to "unlimited" for this case.
Use template.php and override the form functions and apply your logic there before rendering the form.
Example override function

/* Overiding the question creation form */

function yourthemename_question_node_form($form) {
//  dsm($form);
  // Modify title text
  unset($form['title']['#title']);
  // Set a default value for the title field
    // Set a default value for the title field
  $title_value =   $form['title']['#value'];
  if($title_value ==''){
  $form['title']['#value'] = t('Enter Title Here'); 
}
  else { }
  $form['title']['#attributes'] = array(
       'onblur' =&gt; "if (this.value == '') {this.value = '".$form['title']['#value']."';} this.style.color = '#333333';",
         'onfocus' =&gt; "if (this.value == '".$form['title']['#value']."') {this.value = '';} this.style.color = '#333333';" );
  $title = drupal_render($form['title']);
  $body = drupal_render($form['body_field']['body']);
  $form['body_field']['format']['#collapsed'] = FALSE;
  $form['body_field']['format']['#collapsible'] = FALSE;
  $form['body_field']['format']['#title'] = NULL;
  $body_filter = drupal_render($form['body_field']['format']);
  $tags = drupal_render($form['taxonomy']['tags']);
  $thematic_areas = drupal_render($form['taxonomy']['47']);
  $buttons = drupal_render($form['buttons']);
  $remaining_form = drupal_render($form);
    return '&lt;table&gt;&lt;tbody style="border:none;"&gt;&lt;tr&gt;&lt;td style="width:73%;"&gt;&lt;div id="form-title"&gt;'.$title.'&lt;/div&gt;'.'&lt;div id="form-body"&gt;'.$body.'&lt;div id="body-format"&gt;'.$body_filter.'&lt;/div&gt;&lt;/div&gt;&lt;span style="display:none";&gt;'.$remaining_form.'&lt;/span&gt;'.'&lt;/td&gt;&lt;td style="vertical-align:top;"&gt;'.$thematic_areas.$tags.'&lt;div id="publish-post"&gt;'.$buttons.'&lt;/div&gt;'."&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;"; 
}