function uc_order_add_line_item_form_validate in Ubercart 6.2
Same name and namespace in other branches
- 5 uc_order/uc_order.module \uc_order_add_line_item_form_validate()
- 7.3 uc_order/uc_order.admin.inc \uc_order_add_line_item_form_validate()
Validates new line item data.
See also
File
- uc_order/
uc_order.admin.inc, line 1550 - Order administration menu items.
Code
function uc_order_add_line_item_form_validate($form, &$form_state) {
$func = _line_item_data($form_state['values']['line_item_id'], 'callback');
if (function_exists($func) && ($form = $func('form', $form_state['values']['order_id'])) != NULL) {
$func('validate', $form, $form_state);
}
else {
if (!is_numeric($form_state['values']['amount'])) {
form_set_error('amount', t('Amount must be numeric.'));
}
}
}