You are here

function node_field_range_validation in Node Field 7.2

Validate node field in form.

1 string reference to 'node_field_range_validation'
node_field_range_form_node_form_alter in modules/node_field_range/node_field_range.module
Implements hook_form_alter().

File

modules/node_field_range/includes/node_field_range.api.inc, line 11
Api and helpers function for node_field_range module.

Code

function node_field_range_validation($element, &$form_state) {
  $value = (int) $element['#value'];
  $id = $element['#field_id'];
  $result = node_field_range_is_allowed_value($id, $value);
  if (!$result['allowed']) {
    form_error($element, $result['message']);
  }
}