function grouping_validate in Views Grouping Row Limit 6
Same name and namespace in other branches
- 7 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 - Add our options to the form.
File
- ./
views_limit_grouping_style_plugin.inc, line 78 - 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'],
)));
}
}