You are here

function uc_taxes_form_validate in Ubercart 6.2

Same name and namespace in other branches
  1. 7.3 uc_taxes/uc_taxes.admin.inc \uc_taxes_form_validate()

Ensures that tax rates are positive numbers.

See also

uc_taxes_form()

uc_taxes_form_submit()

File

uc_taxes/uc_taxes.admin.inc, line 156
Taxes administration menu items.

Code

function uc_taxes_form_validate($form, &$form_state) {
  if (!empty($form_state['values']['rate']) && floatval($form_state['values']['rate']) < 0) {
    form_set_error('rate', t('Rate must be a positive number. No commas and only one decimal point.'));
  }
}