You are here

function _webform_edit_serial in Webform Serial 7

Implements _webform_edit_component().

File

components/serial.inc, line 42
Webform module serial component.

Code

function _webform_edit_serial($component) {
  $form = array();
  $form['extra']['initial'] = array(
    '#type' => 'textfield',
    '#title' => t('Initial/next value'),
    '#default_value' => empty($component['extra']['initial']) ? 1 : $component['extra']['initial'],
    '#description' => t('The value of the next serial number. This is usually 1 when you start and will go up with each form submission.'),
    '#size' => 8,
    '#maxlength' => 1024,
    '#weight' => 0,
    '#element_validate' => array(
      '_webform_edit_serial_validate',
    ),
  );
  $form['extra']['increment'] = array(
    '#type' => 'textfield',
    '#title' => t('Increment value'),
    '#default_value' => empty($component['extra']['increment']) ? 1 : $component['extra']['increment'],
    '#description' => t('The increment value of the field. Each time the form is submitted, add this many to the serial field.'),
    '#size' => 8,
    '#maxlength' => 1024,
    '#weight' => 0,
    '#element_validate' => array(
      '_webform_edit_serial_validate',
    ),
  );
  return $form;
}