You are here

function uc_taxes_form_validate in Ubercart 7.3

Same name and namespace in other branches
  1. 6.2 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 157
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.'));
  }
}