You are here

function properties_admin_add_more_submit in Dynamic properties 7

Submit handler for the "Add another item" button of a field form.

This handler is run regardless of whether JS is enabled or not. It makes changes to the form state. If the button was clicked with JS disabled, then the page is reloaded with the complete rebuilt form. If the button was clicked with JS enabled, then ajax_form_callback() calls field_add_more_js() to return just the changed part of the form.

1 string reference to 'properties_admin_add_more_submit'
properties_admin_categories_form in ./properties.admin.inc
Form builder; Add/Edit form for categories.

File

./properties.admin.inc, line 537
Contains admin menu callbacks for properties.module.

Code

function properties_admin_add_more_submit($form, &$form_state) {
  $form_state['category']->attributes[] = (object) array(
    'label' => '',
    'name' => '',
    'weight' => count($form_state['category']->attributes),
  );
  $form_state['rebuild'] = TRUE;
}