Hi,

after cloning a fieldset the children have the same name as the original fields, would be nice to autorename the cloned fields maybe like this:

field_original -> field_original_2 -> field_original_3

regards pebosi

Comments

quicksketch’s picture

Status: Active » Closed (works as designed)

This is intentional for a couple reasons. Mostly it's more helpful to have the same keys for everything except the fieldsets themselves. This way you could do looping validation or submission code.

// A silly example but shows why the same name would be helpful.
foreach(array('fieldset1', 'fieldset2') as $fieldset) {
  if ($form_values[$fieldset]['email'] != "test@example.com") {
    form_set_error('email', t('E-mail must be sent to example.com'));
  }
}