You are here

function fivestar_validate in Fivestar 5

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

File

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

Code

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