1

Using hook_form_alter(), how would I change the default of 1-10 then Unlimited, to 1-24 then Unlimited? CCK Only gives 1-10 as options before going to Unlimited and I need to have 1-24. I know this is possible using hook_form_alter() but I do not know the syntax of how to write that.

Any help is greatly appreciated!

1 Answer 1

1
/**
 * Implementation of hook_form_alter().
 */
function YOURMODULENAME_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'content_field_edit_form') {
    $form['field']['multiple']['#options'] = array(1 => t('Unlimited'), 0 => 1) + drupal_map_assoc(range(2, 24));
  }
}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.