You are here

function fivestar_validate in Fivestar 6

Same name and namespace in other branches
  1. 5 fivestar.module \fivestar_validate()
  2. 6.2 fivestar.module \fivestar_validate()
  3. 7.2 fivestar.module \fivestar_validate()
1 string reference to 'fivestar_validate'
fivestar_expand in ./fivestar.module
Process callback for fivestar_element -- see fivestar_element()

File

./fivestar.module, line 1638
A simple n-star voting widget, usable in other forms.

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