Multi-value form widget in a system settings form I'm building a form for a modules configuration page. The last line of the form callback is the following:

return system_settings_from($form);


I want to add a textfield to the form, but I want to be able to enter multiple entires into the field using the same widget you get when manually creating a field of this type (where cardinality > 1) where you get the text field with an "add another item" button.

How can I use that type of widget in a form for a module configuration page?
You won't be able to use the multi-value functionality used in the Field API in your custom forms. 

However, with the Form API and Ajax you should be able to create dynamic form fields. See Ajax Example in the Examples for Developers project. What you want to achieve here is relatively similar to Generate textfields and Generate checkboxes examples, where fields are being added to the form on-the-fly.

&lt;?php
/**
 * Form manipulation through AJAX.
 */
function ajax_example_autocheckboxes($form, &amp;$form_state) {

  // Since the form builder is called after every AJAX request, we rebuild
  // the form based on $form_state.
  $num_checkboxes = !empty($form_state['values']['howmany_select']) ? $form_state['values']['howmany_select'] : 1;

  $form['howmany_select'] = array(
    '#title' =&gt; t('How many checkboxes do you want?'),
    '#type' =&gt; 'select',
    '#options' =&gt; array(1 =&gt; 1, 2 =&gt; 2, 3 =&gt; 3, 4 =&gt; 4),
    '#default_value' =&gt; $num_checkboxes,
    '#ajax' =&gt; array(
      'callback' =&gt; 'ajax_example_autocheckboxes_callback',
      'wrapper' =&gt; 'checkboxes-div',
      'effect' =&gt; 'slide',
    ),
  );

  ...

  for ($i = 1; $i &lt;= $num_checkboxes; $i++) {
    $form['checkboxes_fieldset']["checkbox$i"] = array(
      '#type' =&gt; 'checkbox',
      '#title' =&gt; "Checkbox $i",
    );
  }

  ...

  return $form;
}


/**
 * Callback for autocheckboxes.
 *
 * @return array
 *   Renderable array (the checkboxes fieldset)
 */
function ajax_example_autocheckboxes_callback($form, $form_state) {
  return $form['checkboxes_fieldset'];
}


Another, quick solution that may work (or not) for your case is using an entity (e.g. a single node of a new content type) to store that configuration.