You are here

function currency_form_validate in Currency 7

Same name and namespace in other branches
  1. 5 currency.module \currency_form_validate()
  2. 6 currency.module \currency_form_validate()

Validate handler for the currency exchange form.

File

./currency.module, line 147
This module provides currency exchange rates.

Code

function currency_form_validate($form, &$form_state) {
  if (!$form_state['values']['currency_amount']) {
    form_set_error('currency_amount', t('Amount is required.'));
  }
  if (!is_numeric($form_state['values']['currency_amount'])) {
    form_set_error('currency_amount', t('Invalid Amount. Please enter a valid numeric amount.'));
  }
}