You are here

function grouping_validate in Views Grouping Row Limit 7

Same name and namespace in other branches
  1. 6 views_limit_grouping_style_plugin.inc \grouping_validate()

Validate the added form elements.

1 string reference to 'grouping_validate'
views_limit_grouping_style_plugin::options_form in ./views_limit_grouping_style_plugin.inc
Overrides parent::options_form().

File

./views_limit_grouping_style_plugin.inc, line 108
views_grouping_limit_style_plugin.inc Our handler.

Code

function 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'],
    )));
  }
}