You are here

function contribute_form_validate in Contribute 6

File

./contribute.module, line 82
Lets users contribute to projects

Code

function contribute_form_validate($form, &$form_state) {
  global $user;
  $amount_to_transfer = $form_state['values']['transfer']['amount'];
  $balance = contribute_get_user_balance($user->uid);
  $minimum_contribution = variable_get(contribute_minimum_contribution, array(
    '100',
  ));
  if (!is_numeric($amount_to_transfer)) {
    form_set_error('', t('Must be numeric'));
  }
  elseif ($minimum_contribution > $amount_to_transfer) {
    form_set_error('', t('Sorry the minimum amount is @minimum', array(
      '@minimum' => $minimum_contribution,
    )));
  }
}