function commerce_coupon_handler_area_cart_form::options_validate in Commerce Coupon 7.2
Same name and namespace in other branches
- 7 includes/views/handlers/commerce_coupon_handler_area_cart_form.inc \commerce_coupon_handler_area_cart_form::options_validate()
Validate the options form.
Overrides views_handler::options_validate
File
- includes/
views/ handlers/ commerce_coupon_handler_area_cart_form.inc, line 58 - Display a commerce coupon form field on the cart form.
Class
- commerce_coupon_handler_area_cart_form
- @file Display a commerce coupon form field on the cart form.
Code
function options_validate(&$form, &$form_state) {
$weight = $form_state['values']['options']['weight'];
// Weight must be an integer:
if (!is_null($weight) && !is_numeric($weight) || (int) $weight != $weight) {
form_set_error('options][weight', t('!name field must be an integer.', array(
'!name' => $form['weight']['#title'],
)));
}
}