function fivestar_validate in Fivestar 6.2
Same name and namespace in other branches
- 5 fivestar.module \fivestar_validate()
- 6 fivestar.module \fivestar_validate()
- 7.2 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 1328 - 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'],
)));
}
}