function text_field_widget_settings_form

Implements hook_field_widget_settings_form().

File

modules/field/modules/text/text.module, line 483

Code

function text_field_widget_settings_form($field, $instance) {
    $widget = $instance['widget'];
    $settings = $widget['settings'];
    if ($widget['type'] == 'text_textfield') {
        $form['size'] = array(
            '#type' => 'textfield',
            '#title' => t('Size of textfield'),
            '#default_value' => $settings['size'],
            '#required' => TRUE,
            '#element_validate' => array(
                'element_validate_integer_positive',
            ),
        );
    }
    else {
        $form['rows'] = array(
            '#type' => 'textfield',
            '#title' => t('Rows'),
            '#default_value' => $settings['rows'],
            '#required' => TRUE,
            '#element_validate' => array(
                'element_validate_integer_positive',
            ),
        );
    }
    return $form;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.