Drupal7 add more AJAX Form example . [How to use Drupal AJAX form for multiple fields with add more concept?]
The following code you can use it in either your form alter (form_id alter) or your custom form functions...... function modulename_add_more_form() { $form['description'] = array( '#markup' => '<div>This is an example of a AJAX Form, where we can use AJAX add more concept in drupal for a set of fields.</div>', ); // Because we have many fields with the same values, we have to set // #tree to be able to access them. $form['#tree'] = TRUE; $form['names_fieldset'] = array( '#type' => 'fieldset', '#title' => t('Family member details'), // Set up the wrapper so that AJAX will be able to replace the fieldset. '#prefix' => '<div id="names-fieldset-wrapper">', '#suffix' => '</div>', ); // Build the fieldset with the proper number of names. We'll use // $form_state['num_na...