You are here

function fivestar_validate in Fivestar 7.2

Same name and namespace in other branches
  1. 5 fivestar.module \fivestar_validate()
  2. 6.2 fivestar.module \fivestar_validate()
  3. 6 fivestar.module \fivestar_validate()

An #element_validate function for "fivestar" elements.

1 string reference to 'fivestar_validate'
fivestar_expand in ./fivestar.module
Process callback for fivestar_element -- see fivestar_element()

File

./fivestar.module, line 845

Code

function fivestar_validate($element, &$form_state) {
  if ($element['#required'] && (empty($element['#value']) || $element['#value'] == '-')) {
    form_error($element, t('@name field is required.', array(
      '@name' => $element['#title'],
    )));
  }
}