You are here

function views_complex_grouping_validate in Views Complex Grouping 7

Validate the added form elements.

1 string reference to 'views_complex_grouping_validate'
views_complex_grouping_style_plugin::options_form in ./views_complex_grouping_style_plugin.inc
Overrides parent::options_form().

File

./views_complex_grouping_style_plugin.inc, line 270
views_grouping_complex_style_plugin.inc Our handler.

Code

function views_complex_grouping_validate($element, &$form_state) {

  // Checking to see if numeric.
  if (!is_numeric($element['#value'])) {
    form_error($element, t('%element must be numeric.', array(
      '%element' => $element['#title'],
    )));
  }

  // Checking for negative values.
  if ($element['#value'] < 0) {
    form_error($element, t('%element cannot be negative.', array(
      '%element' => $element['#title'],
    )));
  }
}