function grouping_validate in Views Grouping Row Limit 7
Same name and namespace in other branches
- 6 views_limit_grouping_style_plugin.inc \grouping_validate()
Validate the added form elements.
1 string reference to 'grouping_validate'
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'],
)));
}
}